/* CSOH Website - Modern Clean Design */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --border-color: #dee2e6;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

/* Header & Navigation */
header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.8;
}

/* Header tweaks: logo layout, active link, and focus states */
.logo {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
}

.header-content .logo h1 {
    margin: 0;
    line-height: 1;
}

nav ul {
    align-items: center;
}

nav a {
    transition: opacity 0.3s, background-color 0.15s, transform 0.12s;
}

nav a.active,
nav a[aria-current="page"] {
    background-color: rgba(255,255,255,0.08);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
}

nav a:focus {
    outline: 3px solid rgba(52,152,219,0.18);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 4rem 2rem;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--light-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.section {
    margin-bottom: 4rem;
}

.section h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--secondary-color);
}

.section h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 2rem 0 1rem;
}

/* Filter/Search Bar */
.filter-bar {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-box input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background-color: var(--white);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

/* Resource Cards Grid */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Resources page: use flex layout to avoid empty grid slots */
.category-section .resource-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
    font-size: 0;
}

.category-section .card-link {
    display: block;
    flex: 0 0 350px;
    font-size: 1rem;
}

.presentations-page .resource-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
}

.presentations-page .card-link {
    display: block;
    flex: 0 0 350px;
}

.resource-card {
    background-color: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border-left: 4px solid var(--secondary-color);
    position: relative;
    /* Block layout: content stacks vertically inside card */
    display: block;
}

.resource-card .resource-preview {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    margin: 0 0 1rem 0;
    border: 1px solid var(--border-color);
    display: block;
}

/* News page: use the same card sizing as the rest of the site */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-link .resource-card {
    height: 100%;
}

.card-link:hover .resource-card {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-left-color: var(--primary-color);
    cursor: pointer;
}

/* News page typography alignment */
.news-page .hero h2 {
    font-size: 2.5rem;
}

.news-page .hero p {
    font-size: 1.2rem;
}

.news-page .resource-card h3 {
    font-size: 1.25rem;
}

.news-page .resource-card p {
    font-size: 1rem;
}

.news-page .filter-btn {
    font-size: 0.9rem;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-left-color: var(--primary-color);
    cursor: pointer;
}

.resource-card-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    pointer-events: none;
}

.resource-card-icon.ctf {
    background: linear-gradient(135deg, #e65100, #ff6f00);
}

.resource-card-icon.tool {
    background: linear-gradient(135deg, #6a1b9a, #8e24aa);
}

.resource-card-icon.certification {
    background: linear-gradient(135deg, #1565c0, #1976d2);
}

.resource-card-icon.lab {
    background: linear-gradient(135deg, #c2185b, #d81b60);
}

.resource-card-icon.ai {
    background: linear-gradient(135deg, #00796b, #009688);
}

.resource-card-icon.kubernetes {
    background: linear-gradient(135deg, #326ce5, #5e8ceb);
}

.resource-card h3 {
    font-size: 1.25rem;
    margin: 0 0 0.75rem 0;
    color: var(--primary-color);
}

.resource-card h3 a {
    color: var(--primary-color);
    text-decoration: none;
}

.resource-card h3 a:hover {
    color: var(--secondary-color);
}

.article-date {
    font-size: 0.875rem;
    color: #999;
    margin: 0 0 1rem 0;
    font-weight: 500;
    flex-basis: 100%;
    width: 100%;
}

.resource-card p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.resource-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tag {
    background-color: var(--light-bg);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.tag.new {
    background-color: #e8f5e9;
    color: #2e7d32;
    font-weight: 600;
}

.source {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.tag.ctf {
    background-color: #fff3e0;
    color: #e65100;
}

.tag.certification {
    background-color: #e3f2fd;
    color: #1565c0;
}

.tag.tool {
    background-color: #f3e5f5;
    color: #6a1b9a;
}

.tag.lab {
    background-color: #fce4ec;
    color: #c2185b;
}

/* Category Sections */
.category-section {
    margin-bottom: 3rem;
}

.category-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 1rem;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.category-section h3:hover {
    background-color: var(--light-bg);
}

.category-section h3::before {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.category-section.collapsed h3::before {
    transform: rotate(-90deg);
}

.category-content {
    margin-top: 1rem;
}

.category-section.collapsed .category-content {
    display: none;
}

/* Resource List (Alternative to Grid) */
.resource-list {
    list-style: none;
}

.resource-list li {
    background-color: var(--white);
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    border-radius: 5px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--secondary-color);
    transition: all 0.3s;
}

.resource-list li:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}

.resource-list a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05rem;
}

.resource-list a:hover {
    color: var(--secondary-color);
}

.resource-list .description {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Stats/Info Boxes */
.info-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.info-box {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.info-box h3 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin: 0 0 0.5rem 0;
}

.info-box p {
    color: #666;
    font-size: 1rem;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 3rem 2rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Typography adjustments */
    body {
        font-size: 16px;
    }
    
    /* Header and Navigation - MINIMAL HEADER */
    header {
        padding: 0.5rem 0;
        position: static; /* Not sticky to save space */
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        padding: 0 1rem;
    }
    
    /* Logo - TINY */
    .logo h1 {
        font-size: 1rem;
        margin: 0;
        line-height: 1.2;
    }
    
    .logo p {
        display: none; /* Hide tagline on mobile */
    }

    /* Navigation - HORIZONTAL SCROLLABLE */
    nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    nav::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    nav ul {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0;
        padding: 0;
        margin: 0;
        white-space: nowrap;
    }
    
    nav ul li {
        flex: 0 0 auto;
    }
    
    nav ul li a {
        display: block;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    /* Hero section - MINIMAL */
    .hero {
        padding: 1rem 1rem;
    }
    
    .hero h2 {
        font-size: 1.3rem;
        line-height: 1.2;
        margin-bottom: 0.5rem;
    }
    
    .hero p {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    /* Container padding - COMPACT */
    .container {
        padding: 0 0.75rem;
    }
    
    section {
        padding: 1.5rem 0;
    }

    /* Search and filters - COMPACT */
    .search-filter-container {
        padding: 0.75rem;
    }
    
    .search-box {
        flex-direction: column;
        gap: 1rem;
    }

    .search-box input,
    #searchInput {
        width: 100%;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    .filter-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filter-btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        flex: 1 1 auto;
        min-width: fit-content;
    }

    /* Resource grid */
    .resource-grid,
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .resource-card {
        padding: 1.25rem;
        overflow: hidden;
    }
    
    /* News page responsive: hide images on mobile, show text only */
    .resources-grid .resource-card {
        display: block;
    }
    
    .resources-grid .resource-card .resource-preview {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        max-width: 0 !important;
        margin: 0 !important;
    }
    
    .resource-card h3 {
        font-size: 1.1rem;
    }
    
    .resource-card p {
        font-size: 0.95rem;
    }
    
    .resource-tags {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    
    .tag {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }

    /* Buttons */
    .btn {
        width: 100%;
        text-align: center;
        padding: 1rem;
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }

    /* Statistics boxes */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-box h3 {
        font-size: 2rem;
    }

    /* Info boxes */
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .info-box {
        padding: 1.5rem;
    }

    /* Session cards */
    .sessions-grid {
        grid-template-columns: 1fr;
    }
    
    .session-card {
        padding: 1.25rem;
    }

    /* Footer */
    footer {
        padding: 2rem 1rem 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-section ul {
        padding: 0;
    }

    /* Memorial page specific */
    .memorial-content {
        padding: 1rem;
    }
    
    .memorial-image {
        max-width: 100%;
        margin: 1rem 0;
    }
    
    iframe {
        max-width: 100%;
        height: 400px;
    }

    /* Tables */
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem;
    }

    /* Reduce whitespace */
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
}

/* Extra small devices (phones in portrait, less than 576px) */
@media (max-width: 576px) {
    .logo h1 {
        font-size: 0.9rem;
    }
    
    nav ul li a {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
    
    .hero {
        padding: 0.75rem 0.75rem;
    }
    
    .hero h2 {
        font-size: 1.1rem;
    }
    
    .hero p {
        font-size: 0.85rem;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .resource-card h3 {
        font-size: 1rem;
    }
    
    /* News page phone: images still hidden */
    .resources-grid .resource-card .resource-preview {
        display: none !important;
    }
    
    .stat-box h3 {
        font-size: 1.5rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

.hidden {
    display: none;
}

/* Mobile touch improvements */
@media (hover: none) and (pointer: coarse) {
    /* Improve touch targets on mobile */
    a, button, .filter-btn, .btn {
        min-height: 44px; /* iOS recommended touch target */
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .resource-card:hover,
    .session-card:hover {
        transform: none;
    }
    
    /* But keep active state for feedback */
    .resource-card:active,
    .session-card:active {
        transform: scale(0.98);
    }
    
    .btn:active,
    .filter-btn:active {
        transform: scale(0.95);
    }
}

/* Prevent text selection issues on mobile */
@media (max-width: 768px) {
    .filter-btn,
    .tag {
        user-select: none;
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Improve scrolling performance on mobile */
@media (max-width: 768px) {
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    body {
        overflow-x: hidden;
    }
}
