/* Custom Styles for Lahore Bar Association */
:root {
    --primary-color: #8B0000; /* Dark Red from LBA website */
    --secondary-color: #D4AF37; /* Gold from LBA website */
    --accent-color: #2F4F4F; /* Dark Slate Gray */
    --light-color: #F5F5F5;
    --dark-color: #333333;
    --text-color: #333333;
    --border-color: #DDDDDD;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #ffffff;
}

/* Header Styles */
header.bg-white {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--border-color);
}

header.bg-white .text-dark {
    color: #333333 !important;
    font-weight: 500;
}

header.bg-white a.text-dark:hover {
    color: var(--primary-color) !important;
    text-decoration: none;
}

header.bg-white .text-muted {
    color: #666666 !important;
}

/* Navigation Styles */
.navbar.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #A52A2A 100%) !important;
    border: none;
}

.navbar-light .navbar-nav .nav-link {
    color: white !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar-light .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--secondary-color) !important;
}

/* News Ticker Styles */
.news-ticker {
    background: linear-gradient(135deg, #198754 0%, #157347 100%) !important;
    border-bottom: 2px solid #146c43;
    font-size: 0.95rem;
    position: relative;
    z-index: 1030;
}

.ticker-content {
    overflow: hidden;
    position: relative;
}

.ticker-text {
    display: inline-block;
    padding-left: 100%;
    animation: ticker 30s linear infinite;
    white-space: nowrap;
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

.news-ticker .btn-close {
    opacity: 0.8;
    padding: 0.5rem;
}

.news-ticker .btn-close:hover {
    opacity: 1;
}

/* Pause animation on hover */
.news-ticker:hover .ticker-text {
    animation-play-state: paused;
}

/* Logo Styles */
.header-logo img {
    transition: all 0.3s ease;
    border-radius: 4px;
}

.header-logo img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.footer-logo img {
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.footer-logo img:hover {
    opacity: 1;
}

/* Card Styles */
.card {
    transition: transform 0.2s ease-in-out;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #A52A2A 100%) !important;
    color: white;
    border-bottom: none;
    font-weight: 600;
}

.card-header.bg-warning {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #E6C200 100%) !important;
    color: var(--dark-color);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #A52A2A 100%);
    border: none;
    color: white;
    font-weight: 500;
    padding: 8px 20px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #A52A2A 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.3);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    font-weight: 500;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #E6C200 100%);
    border: none;
    color: var(--dark-color);
}

/* Badge Styles */
.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #A52A2A 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #E6C200 100%) !important;
    color: var(--dark-color);
}

.badge.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

/* Text Colors */
.text-primary {
    color: var(--primary-color) !important;
}

.text-warning {
    color: var(--secondary-color) !important;
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, var(--accent-color) 0%, #3D5A5A 100%);
    color: white;
}

footer h5 {
    color: var(--secondary-color);
    font-weight: 600;
}

footer a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--secondary-color);
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--secondary-color);
    color: var(--dark-color) !important;
    transform: translateY(-3px);
}

/* Admin Styles */
.sidebar {
    background-color: var(--light-color);
    min-height: calc(100vh - 76px);
    border-right: 1px solid var(--border-color);
}

.list-group-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #A52A2A 100%) !important;
    border-color: var(--primary-color);
    font-weight: 600;
}

.list-group-item:hover:not(.active) {
    background-color: rgba(139, 0, 0, 0.05);
}

/* Table Styles */
.table th {
    border-top: none;
    font-weight: 600;
    color: var(--primary-color);
    background-color: var(--light-color);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(139, 0, 0, 0.02);
}

/* Modal Styles */
.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #A52A2A 100%);
    color: white;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Breadcrumb Styles */
.breadcrumb {
    background-color: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-item.active {
    color: var(--accent-color);
}

/* Format Toolbar Styles */
.format-toolbar {
    background: var(--light-color);
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 8px;
    border-radius: 5px 5px 0 0;
}

.format-toolbar .btn-group {
    margin-right: 5px;
}

.format-toolbar .btn {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.format-toolbar .btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

#newsContent, #editNewsContent {
    border-radius: 0 0 5px 5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    border: 1px solid var(--border-color);
}

/* Gallery Image Styles */
.gallery-image-container {
    position: relative;
    margin-bottom: 10px;
}

.gallery-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    opacity: 0.8;
    width: 25px;
    height: 25px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    border: none;
}

.gallery-delete-btn:hover {
    opacity: 1;
    background: #A52A2A;
}

/* News Detail Page Styles */
.news-detail .main-image {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.news-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.news-content h1,
.news-content h2,
.news-content h3,
.news-content h4 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.news-content h1 { 
    font-size: 2rem; 
    border-bottom: 2px solid var(--secondary-color); 
    padding-bottom: 0.5rem; 
}
.news-content h2 { 
    font-size: 1.75rem; 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 0.5rem; 
}
.news-content h3 { font-size: 1.5rem; }
.news-content h4 { font-size: 1.25rem; }

.news-content p {
    margin-bottom: 1.5rem;
}

.news-content strong {
    font-weight: bold;
    color: var(--primary-color);
}

.news-content em {
    font-style: italic;
    color: var(--accent-color);
}

.news-content u {
    text-decoration: underline;
    color: var(--primary-color);
}

.news-content ul,
.news-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.news-content li {
    margin-bottom: 0.5rem;
}

.news-content ul {
    list-style-type: disc;
}

.news-content ol {
    list-style-type: decimal;
}

.news-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.news-content a:hover {
    color: #A52A2A;
    text-decoration: underline;
}

.news-content blockquote {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1rem;
    margin-left: 0;
    font-style: italic;
    color: var(--accent-color);
    background: var(--light-color);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

/* Gallery Item Hover Effects */
.gallery-item img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 3px solid transparent;
}

.gallery-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border-color: var(--secondary-color);
}

/* Lightbox Styles */
#lightboxModal .modal-content {
    background-color: rgba(0,0,0,0.95);
    border: 2px solid var(--secondary-color);
}

#lightboxModal .modal-header {
    background: transparent;
    border-bottom: 1px solid #444;
}

#lightboxModal .modal-footer {
    border-top: 1px solid #444;
    background: transparent;
}

#lightboxImage {
    max-height: 70vh;
    object-fit: contain;
}

/* Alert Styles */
.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
    color: #155724;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #17a2b8;
    color: #0c5460;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid var(--secondary-color);
    color: #856404;
}

/* Form Styles */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(139, 0, 0, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(139, 0, 0, 0.25);
}

/* Member Cards for Elected Bodies */
.member-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.member-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(139, 0, 0, 0.15);
}

.member-image-container {
    position: relative;
    display: inline-block;
}

.member-image-container img,
.member-image-container .default-avatar {
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.member-image-container:hover img,
.member-image-container:hover .default-avatar {
    border-color: var(--secondary-color);
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(139, 0, 0, 0.8);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.member-image-container:hover .image-overlay {
    opacity: 1;
}

.image-overlay i {
    margin-bottom: 5px;
}

.image-overlay span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Member Modal Styles */
#memberModal .modal-content {
    border: 3px solid var(--primary-color);
    border-radius: 10px;
    overflow: hidden;
}

#memberModal .modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #A52A2A 100%);
    color: white;
    border-bottom: none;
}

#memberModal .modal-body {
    background: white;
}

.profile-details {
    height: 100%;
}

.profile-text {
    line-height: 1.6;
    color: var(--text-color);
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.profile-text::-webkit-scrollbar {
    width: 6px;
}

.profile-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.profile-text::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.profile-text::-webkit-scrollbar-thumb:hover {
    background: #A52A2A;
}

/* Large Image in Modal */
#memberModalImage img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border: 5px solid var(--secondary-color);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#memberModalImage .default-avatar {
    width: 200px;
    height: 200px;
    background: var(--light-color);
    border: 5px solid var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#memberModalImage .default-avatar i {
    font-size: 3rem;
    color: var(--accent-color);
}

.member-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Admin Dashboard Styles */
.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 10px;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .news-ticker {
        font-size: 0.85rem;
        padding: 8px 0;
    }
    
    .ticker-text {
        animation: ticker 20s linear infinite;
    }
    
    .news-ticker .badge {
        font-size: 0.7em;
    }
    
    .header-logo img {
        max-height: 50px !important;
        max-width: 150px !important;
    }
    
    .footer-logo img {
        max-height: 40px !important;
        max-width: 120px !important;
    }
    
    header.bg-white {
        padding: 15px 0;
    }
    
    header.bg-white .text-end {
        text-align: left !important;
        margin-top: 10px;
    }
    
    header.bg-white .d-flex.justify-content-end {
        justify-content: flex-start !important;
    }
    
    .member-image-container img,
    .member-image-container .default-avatar {
        width: 120px !important;
        height: 120px !important;
    }
    
    #memberModalImage img,
    #memberModalImage .default-avatar {
        width: 150px !important;
        height: 150px !important;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    #memberModal .modal-body .row {
        flex-direction: column;
    }
    
    #memberModal .col-md-5,
    #memberModal .col-md-7 {
        width: 100%;
    }
    
    .navbar-brand h1 {
        font-size: 1.25rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .gallery-item img {
        height: 150px !important;
    }
}

/* Print Styles */
@media print {
    .navbar, .btn, footer, .breadcrumb, .share-section {
        display: none !important;
    }
    
    .news-content {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .modal-header,
    .modal-footer,
    .btn {
        display: none !important;
    }
    
    .modal-content {
        border: none !important;
        box-shadow: none !important;
    }
    
    .modal-body {
        background: white !important;
    }
}

/* Utility Classes */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.main-image img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

#mainLightboxImage {
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}