/* ===== STANDARDIZED BANNER DESIGN SYSTEM ===== */

/* Base App Banner Class - Reusable across all banners */
.app-banner {
    position: relative;
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    color: white;
    margin: -1rem -1.5rem 2rem -1.5rem;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.2);
    overflow: hidden;
    padding: 0;
}

/* Banner Background Effects */
.app-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

.app-banner::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='7' cy='7' r='7'/%3E%3Ccircle cx='53' cy='53' r='7'/%3E%3Ccircle cx='30' cy='30' r='7'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

/* Banner Content Container */
.app-banner-content {
    position: relative;
    z-index: var(--z-content-above);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Banner Main Section */
.app-banner-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1 1 auto;
    min-width: 280px;
}

.app-banner-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.app-banner-icon .feather,
.app-banner-icon svg[data-feather] {
    stroke: #fff !important;
    color: #fff !important;
}

/* Banner Text Styles - Fixed font colors */
.app-banner-text {
    flex: 1;
    min-width: 140px;
}

.app-banner-title {
    font-size: 2rem !important;
    font-weight: 700 !important;
    margin: 0 0 0.5rem 0 !important;
    line-height: 1.2 !important;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-banner-subtitle {
    font-size: 1rem !important;
    color: rgba(255, 255, 255, 0.95) !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    font-weight: 400 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* Banner Actions */
.app-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 1;
    flex-wrap: wrap;
}

.app-banner-btn {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 12px !important;
    color: white !important;
    text-decoration: none !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px) !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.app-banner-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: white !important;
    text-decoration: none !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.app-banner-btn .feather,
.app-banner-btn svg[data-feather] {
    stroke: #fff !important;
    color: #fff !important;
}

/* Banner Variants */
.app-banner.announcements {
    background: linear-gradient(135deg, #7c3aed 0%, #c084fc 50%, #3b82f6 100%);
}

.app-banner.services {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #9333ea 100%);
}

.app-banner.members {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
}

.app-banner.admin {
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 50%, #6d28d9 100%);
}

/* Dark mode: deepen the coloured banners so they don't glare on the dark page
   while keeping their brand hue. */
[data-theme="dark"] .app-banner.members { background: linear-gradient(135deg, #b45309 0%, #92400e 55%, #78350f 100%); }
[data-theme="dark"] .app-banner.admin { background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 55%, #4c1d95 100%); }
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .app-banner.members { background: linear-gradient(135deg, #b45309 0%, #92400e 55%, #78350f 100%); }
    [data-theme="auto"] .app-banner.admin { background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 55%, #4c1d95 100%); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-banner {
        margin: -1rem -1rem 1.5rem -1rem;
        border-radius: 0 0 16px 16px;
    }
    
    .app-banner-content {
        padding: 1.5rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .app-banner-main {
        width: 100%;
        gap: 0.75rem;
    }
    
    .app-banner-icon {
        width: 40px;
        height: 40px;
    }
    
    .app-banner-title {
        font-size: 1.5rem !important;
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
    }
    
    .app-banner-subtitle {
        font-size: 0.875rem !important;
    }
    
    .app-banner-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .app-banner-btn {
        padding: 0.625rem 1.25rem !important;
        font-size: 0.875rem !important;
    }
}

/* Tablet Responsive */
@media (max-width: 991px) and (min-width: 769px) {
    .app-banner-content {
        padding: 1.75rem 1.5rem;
    }
    
    .app-banner-title {
        font-size: 1.75rem !important;
    }
}

/* Ensure proper spacing after banners */
.app-banner + .container-fluid,
.app-banner + .container,
.app-banner + .page-content,
.app-banner + .dashboard-widgets,
.app-banner + .row {
    margin-top: 0 !important;
}

/* Fix for pages that use the banner */
.has-app-banner {
    padding-top: 0 !important;
}

.has-app-banner .page-header {
    display: none; /* Hide old page headers when using app banner */
}

/* Add proper spacing below banners instead of using spacer divs */
.app-banner {
    margin-bottom: 2rem !important;
}

@media (max-width: 768px) {
    .app-banner {
        margin-bottom: 1.5rem !important;
    }
}

/* ===== LEGACY BANNER FIXES ===== */

/* Fix existing page-header styling */
.page-header {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 0 2rem 0 !important;
}

.page-header .page-title {
    color: #1e293b !important;
    font-weight: 600 !important;
    margin: 0 0 0.5rem 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

.page-header .page-title i {
    color: #7c3aed !important;
}

.page-header .page-subtitle {
    color: #4b5563 !important;
    margin: 0 !important;
    font-size: 1rem !important;
}

/* Dark mode overrides for page headers */
[data-theme="dark"] .page-header .page-title {
    color: var(--text-primary, #f1f5f9) !important;
}

[data-theme="dark"] .page-header .page-title i {
    color: #a78bfa !important;
}

[data-theme="dark"] .page-header .page-subtitle {
    color: var(--text-secondary, #cbd5e1) !important;
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .page-header .page-title {
        color: var(--text-primary, #f1f5f9) !important;
    }
    [data-theme="auto"] .page-header .page-title i {
        color: #a78bfa !important;
    }
    [data-theme="auto"] .page-header .page-subtitle {
        color: var(--text-secondary, #cbd5e1) !important;
    }
}

/* ===== ANNOUNCEMENT SPECIFIC STYLES ===== */

/* Fix announcement list styling */
.announcements-list .modern-card {
    border-radius: 16px !important;
    border: 1px solid rgba(124, 58, 237, 0.1) !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.08) !important;
    transition: all 0.2s ease !important;
}

.announcements-list .modern-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.15) !important;
}

.announcements-list .card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-bottom: 1px solid rgba(124, 58, 237, 0.1) !important;
    border-radius: 16px 16px 0 0 !important;
}

.announcements-list .card-title {
    color: #1e293b !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .announcements-list .card-header {
    background: var(--background-secondary, #161822) !important;
    border-bottom-color: var(--border, #2a2d3a) !important;
}

[data-theme="dark"] .announcements-list .card-title {
    color: var(--text-primary, #f1f5f9) !important;
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .announcements-list .card-header {
        background: var(--background-secondary, #161822) !important;
        border-bottom-color: var(--border, #2a2d3a) !important;
    }
    [data-theme="auto"] .announcements-list .card-title {
        color: var(--text-primary, #f1f5f9) !important;
    }
}

/* ===== RESPONSIVE UTILITIES ===== */

/* Ensure banners work well in all containers */
@media (max-width: 576px) {
    .app-banner {
        margin: -0.75rem -0.75rem 1rem -0.75rem;
    }
    
    .app-banner-content {
        padding: 1.25rem 0.75rem;
    }
}

/* High contrast mode compatibility */
@media (prefers-contrast: high) {
    .app-banner {
        border: 2px solid white;
    }
    
    .app-banner-title,
    .app-banner-subtitle {
        text-shadow: none !important;
    }
}

/* Reduced motion compatibility */
@media (prefers-reduced-motion: reduce) {
    .app-banner,
    .app-banner-btn {
        transition: none !important;
    }
    
    .app-banner-btn:hover {
        transform: none !important;
    }
}