/**
 * Subject Areas Archive Styles - DNCG Branded
 * 
 * @package DNCG_Pathways
 * @version 2.1.0
 * 
 * File Location: /public/css/archive-subject-areas.css
 * 
 * Brand Colors:
 * Primary: #15244a (Navy Blue)
 * Secondary: #009db7 (Teal)
 */

/* ========================================
   CSS VARIABLES - Brand Colors
   ======================================== */

:root {
    /* Brand Colors */
    --dncg-primary: #15244a;
    --dncg-primary-dark: #0d1629;
    --dncg-primary-light: #1d3166;
    --dncg-secondary: #009db7;
    --dncg-secondary-dark: #007d96;
    --dncg-secondary-light: #00bdd6;
    
    /* Neutral Colors */
    --dncg-white: #ffffff;
    --dncg-gray-50: #f9fafb;
    --dncg-gray-100: #f3f4f6;
    --dncg-gray-200: #e5e7eb;
    --dncg-gray-300: #d1d5db;
    --dncg-gray-400: #9ca3af;
    --dncg-gray-500: #6b7280;
    --dncg-gray-600: #4b5563;
    --dncg-gray-700: #374151;
    --dncg-gray-800: #1f2937;
    --dncg-gray-900: #111827;
    
    /* Functional Colors */
    --dncg-background: #f5f7fa;
    --dncg-text-primary: #1f2937;
    --dncg-text-secondary: #4a5568;
    --dncg-text-light: #718096;
    --dncg-border: #e2e8f0;
    --dncg-border-light: #edf2f7;
    
    /* Shadows */
    --dncg-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --dncg-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --dncg-shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.15);
    --dncg-shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    
    /* Transitions */
    --dncg-transition: all 0.3s ease;
    --dncg-transition-fast: all 0.15s ease;
}

/* ========================================
   Archive Wrapper
   ======================================== */

.dncg-subject-areas-archive-wrapper {
    min-height: 100vh;
    background: var(--dncg-background);
}

/* ========================================
   Hero Section - Brand Gradient
   ======================================== */

.dncg-archive-hero {
    background: linear-gradient(135deg, var(--dncg-primary) 0%, var(--dncg-secondary) 100%);
    padding: 100px 0 80px;
    position: relative;
    overflow: hidden;
}

.dncg-archive-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    50% { 
        transform: translateY(-20px) rotate(180deg); 
    }
}

.dncg-archive-hero-content {
    position: relative;
    z-index: 1;
}

/* Container Styles */
.dncg-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.dncg-container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Typography */
.dncg-archive-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--dncg-white);
    margin: 0 0 20px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    letter-spacing: -0.02em;
}

.dncg-archive-intro {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.95);
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    line-height: 1.6;
}

/* ========================================
   Filters Section - Sticky Bar
   ======================================== */

.dncg-filters-section {
    background: var(--dncg-white);
    padding: 30px 0;
    box-shadow: var(--dncg-shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--dncg-border-light);
}

.dncg-filter-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dncg-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.dncg-filter-group {
    flex: 1;
    min-width: 250px;
}

.dncg-filter-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dncg-text-secondary);
    margin-bottom: 8px;
}

/* Filter Select Styles */
.dncg-filter-select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--dncg-border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--dncg-white);
    color: var(--dncg-text-primary);
    transition: var(--dncg-transition);
    cursor: pointer;
}

.dncg-filter-select:hover {
    border-color: var(--dncg-gray-300);
}

.dncg-filter-select:focus {
    outline: none;
    border-color: var(--dncg-primary);
    box-shadow: 0 0 0 3px rgba(21, 36, 74, 0.1);
}

/* Filter Actions */
.dncg-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ========================================
   Button Styles - Brand Colors
   ======================================== */

.dncg-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--dncg-transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    line-height: 1.5;
}

/* Primary Button - Navy */
.dncg-btn-primary {
    background: var(--dncg-primary);
    color: var(--dncg-white);
    border: 2px solid var(--dncg-primary);
}

.dncg-btn-primary:hover {
    background: var(--dncg-primary-dark);
    border-color: var(--dncg-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(21, 36, 74, 0.3);
}

.dncg-btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button - Teal */
.dncg-btn-secondary {
    background: var(--dncg-secondary);
    color: var(--dncg-white);
    border: 2px solid var(--dncg-secondary);
}

.dncg-btn-secondary:hover {
    background: var(--dncg-secondary-dark);
    border-color: var(--dncg-secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 157, 183, 0.3);
}

/* Outline Button */
.dncg-btn-outline {
    background: transparent;
    color: var(--dncg-primary);
    border: 2px solid var(--dncg-primary);
}

.dncg-btn-outline:hover {
    background: var(--dncg-primary);
    color: var(--dncg-white);
}

/* Ghost Button */
.dncg-btn-ghost {
    background: var(--dncg-gray-100);
    color: var(--dncg-text-secondary);
    border: 2px solid transparent;
}

.dncg-btn-ghost:hover {
    background: var(--dncg-gray-200);
    color: var(--dncg-text-primary);
}

/* Button States */
.dncg-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.dncg-btn:focus-visible {
    outline: 3px solid var(--dncg-primary);
    outline-offset: 2px;
}

/* ========================================
   Results Bar
   ======================================== */

.dncg-results-bar {
    padding: 20px 0;
    border-bottom: 1px solid var(--dncg-border);
    margin-bottom: 30px;
}

.dncg-results-count {
    font-size: 1.1rem;
    color: var(--dncg-text-secondary);
    font-weight: 500;
}

.dncg-results-count strong {
    color: var(--dncg-primary);
    font-weight: 700;
}

/* ========================================
   Subject Areas Grid
   ======================================== */

.dncg-subject-areas-grid-section {
    padding: 40px 0 80px;
}

.dncg-subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

/* ========================================
   Subject Tile - Card Design
   ======================================== */

.dncg-subject-tile {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--dncg-shadow);
    transition: var(--dncg-transition);
    background: var(--dncg-white);
    min-height: 350px;
}

.dncg-subject-tile:hover {
    transform: translateY(-8px);
    box-shadow: var(--dncg-shadow-lg);
}

.dncg-subject-tile-link {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Tile Image & Overlay */
.dncg-tile-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--dncg-primary);
}

.dncg-tile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0.2) 0%, 
        rgba(0,0,0,0.7) 100%);
    transition: opacity 0.3s ease;
}

.dncg-subject-tile:hover .dncg-tile-overlay {
    opacity: 0.9;
}

/* Tile Content */
.dncg-tile-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px;
    color: var(--dncg-white);
    z-index: 1;
}

.dncg-tile-header {
    flex-grow: 1;
}

.dncg-tile-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--dncg-white);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    letter-spacing: -0.01em;
}

.dncg-tile-intro {
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.95;
    margin: 0;
}

/* Tile Stats */
.dncg-tile-stats {
    display: flex;
    gap: 20px;
    padding: 15px 0;
    border-top: 1px solid rgba(255,255,255,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    margin: 20px 0;
}

.dncg-stat-item {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.95;
}

.dncg-stat-item svg {
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}

/* ========================================
   Explore Button - Brand Styled
   ======================================== */

.dncg-tile-cta {
    margin-top: auto;
}

.dncg-explore-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 157, 183, 0.2);
    border: 2px solid var(--dncg-white);
    border-radius: 25px;
    color: var(--dncg-white);
    font-weight: 600;
    transition: var(--dncg-transition);
}

.dncg-subject-tile:hover .dncg-explore-btn {
    background: var(--dncg-secondary);
    border-color: var(--dncg-secondary);
    color: var(--dncg-white);
    transform: translateX(5px);
}

.dncg-explore-btn svg {
    transition: transform 0.3s ease;
}

.dncg-subject-tile:hover .dncg-explore-btn svg {
    transform: translateX(5px);
}

/* ========================================
   No Results State
   ======================================== */

.dncg-no-subjects-found {
    text-align: center;
    padding: 80px 20px;
}

.dncg-no-subjects-content {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px;
    background: var(--dncg-white);
    border-radius: 12px;
    box-shadow: var(--dncg-shadow);
}

.dncg-no-subjects-content svg {
    stroke: var(--dncg-gray-300);
    margin-bottom: 20px;
}

.dncg-no-subjects-content h3 {
    font-size: 1.5rem;
    color: var(--dncg-text-primary);
    margin: 0 0 15px;
}

.dncg-no-subjects-content p {
    color: var(--dncg-text-light);
    line-height: 1.6;
    margin: 0 0 25px;
}


/* ========================================
   Accessibility & Focus States
   ======================================== */

/* Focus Indicators */
.dncg-subject-tile-link:focus-visible {
    outline: 3px solid var(--dncg-primary);
    outline-offset: 4px;
}

.dncg-btn:focus-visible,
.dncg-filter-select:focus-visible {
    outline: 3px solid var(--dncg-primary);
    outline-offset: 2px;
}

/* Selection Color */
::selection {
    background: var(--dncg-secondary);
    color: var(--dncg-white);
}

::-moz-selection {
    background: var(--dncg-secondary);
    color: var(--dncg-white);
}

/* Skip to Content */
.dncg-skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--dncg-primary);
    color: var(--dncg-white);
    padding: 10px 20px;
    text-decoration: none;
    z-index: 1000;
}

.dncg-skip-to-content:focus {
    top: 0;
}

/* ========================================
   Loading States
   ======================================== */

.dncg-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.dncg-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--dncg-gray-300);
    border-top-color: var(--dncg-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Filter form loading */
.dncg-filter-form.loading {
    opacity: 0.6;
}

.dncg-filter-form.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    border: 2px solid var(--dncg-gray-300);
    border-top-color: var(--dncg-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablets */
@media (max-width: 768px) {
    .dncg-archive-hero {
        padding: 80px 0 60px;
    }
    
    .dncg-archive-title {
        font-size: 2.5rem;
    }
    
    .dncg-archive-intro {
        font-size: 1.1rem;
    }
    
    .dncg-filter-row {
        flex-direction: column;
    }
    
    .dncg-filter-group {
        min-width: 100%;
    }
    
    .dncg-filter-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .dncg-filter-actions .dncg-btn {
        width: 100%;
        justify-content: center;
    }
    
    .dncg-subject-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dncg-tile-title {
        font-size: 1.5rem;
    }
    
    .dncg-tile-stats {
        flex-wrap: wrap;
        gap: 15px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .dncg-archive-hero {
        padding: 60px 0 40px;
    }
    
    .dncg-archive-title {
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .dncg-archive-intro {
        font-size: 1rem;
    }
    
    .dncg-filters-section {
        padding: 20px 0;
    }
    
    .dncg-tile-content {
        padding: 20px;
    }
    
    .dncg-tile-title {
        font-size: 1.3rem;
    }
    
    .dncg-tile-intro {
        font-size: 0.9rem;
    }
    
    .dncg-explore-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* Large Screens */
@media (min-width: 1400px) {
    .dncg-subject-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .dncg-archive-hero,
    .dncg-filters-section,
    .dncg-explore-btn {
        display: none;
    }
    
    .dncg-subject-tile {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--dncg-gray-300);
    }
    
    .dncg-tile-overlay {
        display: none;
    }
    
    .dncg-tile-content {
        color: var(--dncg-text-primary);
    }
}