/* Main CSS File - Koła Naukowe CMS System */
/* 
 * NOTE: This file contains all styles consolidated for reliable loading.
 * Individual component files are kept in the same directory for reference and future maintenance:
 * - variables.css (CSS custom properties)
 * - base.css (global base styles)
 * - utilities.css (accessibility & responsive)
 * - components.css (language switcher & components)
 * - org-styles.css (organization-specific styles)
 */

/* ========================================
   CSS Custom Properties - WCAG AAA Compliant
   ======================================== */
:root {
    --uws-primary: #003d7c;
    --uws-primary-dark: #002a56;
    --uws-primary-light: #0056b3;
    --uws-secondary: #ffffff;
    --uws-accent: #f8f9fa;
    --uws-text: #212529;
    --uws-text-muted: #6c757d;
    --uws-border: #dee2e6;
    --uws-success: #198754;
    --uws-warning: #ffc107;
    --uws-danger: #dc3545;
    --uws-info: #0dcaf0;
    
    /* High contrast ratios for AAA compliance */
    --text-on-primary: #ffffff;
    --text-on-secondary: #212529;
    --text-on-accent: #212529;
    
    /* Spacing system */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    /* Typography */
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    
    /* Border radius */
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-base: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

/* ========================================
   Global Base Styles
   ======================================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--uws-text);
    background-color: var(--uws-secondary);
}

/* Add padding only to main content areas, not under construction pages */
main {
    padding-top: 100px; /* Account for fixed header */
}

/* Focus indicators for accessibility */
*:focus {
    outline: 3px solid var(--uws-primary);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--uws-primary);
    color: var(--text-on-primary);
    padding: 8px;
    text-decoration: none;
    border-radius: var(--border-radius);
    z-index: 1000;
    transition: var(--transition-base);
}

.skip-link:focus {
    top: 6px;
}

/* ========================================
   Component Styles
   ======================================== */

/* Main Organization Page Link Title */
.main-org-page-link-title {
    padding: 0 10px;
}

/* Language Switcher Styles */
.language-switcher {
    margin: 0 10px;
}
.flag-icon {
    display: inline-block;
    margin-right: 5px;
}

/* Fix hover styles for organization colors */
.language-switcher .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: inherit !important;
}

.language-switcher .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: inherit !important;
}

.language-switcher .dropdown-item:active {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: inherit !important;
}

/* ========================================
   Organization Header Styles - WCAG AAA Compliant
   ======================================== */

/* Organization header styles */
.org-header {
    min-height: 60px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.org-header .navbar-brand img {
    transition: height 0.3s ease;
}

.org-breadcrumb {
    font-size: 0.9rem;
    opacity: 0.9;
}

.breadcrumb-separator {
    opacity: 0.6;
}

.org-name {
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.org-header .navbar-nav .nav-link {
    color: inherit;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.org-header .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: inherit;
}

.org-header .navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: inherit;
}

.org-header .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.3);
    color: inherit;
}

.org-header .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: inherit;
}

/* Mobile menu styles */
.org-mobile-menu {
    background-color: var(--uws-secondary);
}

.org-mobile-info h5 {
    color: var(--uws-primary);
    margin: 0;
}

.mobile-menu-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--uws-text);
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.mobile-menu-item:hover {
    background-color: var(--uws-accent);
    color: var(--uws-text);
    text-decoration: none;
}

.mobile-menu-item.active {
    background-color: var(--uws-primary);
    color: var(--text-on-primary);
}

/* ========================================
   Organization Homepage Styles - WCAG AAA Compliant
   ======================================== */

/* Organization homepage styles */
.org-hero {
    background: linear-gradient(135deg, var(--uws-primary) 0%, var(--uws-primary-dark) 100%);
    color: var(--text-on-primary);
    padding: var(--spacing-xxl) 0;
    position: relative;
    overflow: hidden;
}

.org-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.02)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.02)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.02)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
    z-index: 1;
}

.org-hero-content {
    position: relative;
    z-index: 2;
}

.org-hero-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.org-hero-subtitle {
    font-size: var(--font-size-xl);
    font-weight: 400;
    margin-bottom: var(--spacing-lg);
    opacity: 0.95;
    max-width: 600px;
}

.org-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--uws-secondary);
    color: var(--uws-primary);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-base);
    box-shadow: var(--shadow);
}

.org-hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--uws-primary);
    text-decoration: none;
}

.org-hero-cta:focus {
    outline: 3px solid var(--uws-secondary);
    outline-offset: 2px;
}

/* Content sections */
.content-section {
    padding: var(--spacing-xxl) 0;
}

/* News grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.news-card {
    background: var(--uws-secondary);
    border: 1px solid var(--uws-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition-base);
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--uws-primary);
    text-decoration: none;
    color: inherit;
}

.news-card:focus {
    outline: 3px solid var(--uws-primary);
    outline-offset: 2px;
}

.news-image {
    width: 100%;
    height: 200px;
    background: var(--uws-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--uws-primary);
    font-size: var(--font-size-2xl);
}

.news-content {
    padding: var(--spacing-lg);
}

.news-date {
    font-size: var(--font-size-base);
    color: var(--uws-text-muted);
    margin-bottom: var(--spacing-sm);
}

.news-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--uws-text);
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

.news-excerpt {
    font-size: var(--font-size-base);
    color: var(--uws-text-muted);
    line-height: 1.6;
}

/* Events section */
.events-section {
    background: var(--uws-accent);
    padding: var(--spacing-xxl) 0;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.event-card {
    background: var(--uws-secondary);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.event-date {
    display: inline-block;
    background: var(--uws-primary);
    color: var(--text-on-primary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.event-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--uws-text);
    margin-bottom: var(--spacing-sm);
}

.event-description {
    font-size: var(--font-size-base);
    color: var(--uws-text-muted);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.event-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-base);
    color: var(--uws-text-muted);
}

.event-meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.event-meta-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* People section */
.people-section {
    padding: var(--spacing-xxl) 0;
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.person-card {
    background: var(--uws-secondary);
    border: 1px solid var(--uws-border);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    transition: var(--transition-base);
}

.person-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--uws-primary);
}

.person-avatar {
    width: 80px;
    height: 80px;
    background: var(--uws-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md) auto;
    font-size: var(--font-size-2xl);
    color: var(--uws-primary);
    font-weight: 700;
}

.person-name {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--uws-text);
    margin-bottom: var(--spacing-xs);
}

.person-role {
    font-size: var(--font-size-base);
    color: var(--uws-text-muted);
    margin-bottom: var(--spacing-sm);
}

.person-description {
    font-size: var(--font-size-base);
    color: var(--uws-text-muted);
    line-height: 1.6;
}

/* Contact section */
.contact-section {
    background: var(--uws-accent);
    padding: var(--spacing-xxl) 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

.contact-info {
    background: var(--uws-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.contact-info h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--uws-text);
    margin-bottom: var(--spacing-md);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-base);
    color: var(--uws-text);
}

.contact-icon {
    width: 20px;
    height: 20px;
    color: var(--uws-primary);
    flex-shrink: 0;
}

/* ========================================
   Accessibility and Utility Styles
   ======================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn,
    .card,
    .nav-link {
        border-width: 2px;
    }
    
    .org-header {
        border-bottom: 2px solid currentColor;
    }
    
    .org-header .navbar-nav .nav-link {
        border: 1px solid transparent;
    }
    
    .org-header .navbar-nav .nav-link:hover,
    .org-header .navbar-nav .nav-link.active {
        border-color: currentColor;
    }
    
    .news-card,
    .event-card,
    .person-card,
    .contact-info {
        border-width: 2px;
    }
    
    .org-hero-cta {
        border: 2px solid var(--uws-primary);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .org-header,
    .org-header .navbar-brand img,
    .org-header .navbar-nav .nav-link,
    .org-header .btn-outline-light,
    .news-card,
    .event-card,
    .person-card,
    .org-hero-cta {
        transition: none;
    }
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .skip-link {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .org-header .navbar-brand img {
        height: 32px;
    }
    
    .org-breadcrumb {
        display: none !important;
    }
    
    .org-hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .org-hero-subtitle {
        font-size: var(--font-size-lg);
    }
    
    .news-grid,
    .events-grid,
    .people-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .org-hero {
        padding: var(--spacing-xl) 0;
    }
    
    .content-section {
        padding: var(--spacing-xl) 0;
    }
    
    .news-content,
    .event-card,
    .person-card,
    .contact-info {
        padding: var(--spacing-md);
    }
}