/* ========================================
   VISUAL ENHANCEMENTS & EDUCATIONAL THEME
   ======================================== */

/* Decorative Background Patterns - Tech Hexagons */
/* Decorative Background Patterns - Tech Hexagons H3 Style */
.app-container {
    position: relative;
    z-index: 1;
}

/* Level 0: Global Base Grid (Fine Mesh) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Hexagon Pattern - Level 0 */
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='104' viewBox='0 0 60 104' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l30 17.32v34.64L30 69.28 0 51.96V17.32zM30 103.92L0 86.6V51.96l30-17.32 30 17.32v34.64z' fill='none' stroke='rgba(99, 102, 241, 0.03)' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 60px 104px;
    z-index: -2;
    pointer-events: none;
}

/* Level 1: Large Floating Hexagons (H3 Cells) */
.hex-overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.hex-level-1 {
    position: absolute;
    width: 400px;
    height: 460px;
    /* Approx height for hex ratio */
    background:
        radial-gradient(circle at 50% 50%, rgba(30, 58, 138, 0.02) 20%, transparent 70%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid rgba(13, 148, 136, 0.05);
}

/* Positioning Hexagons */
.hex-1 {
    top: -100px;
    right: -50px;
    animation: pulseHex 10s ease-in-out infinite;
}

.hex-2 {
    bottom: 10%;
    left: -100px;
    width: 300px;
    height: 345px;
    animation: pulseHex 15s ease-in-out infinite reverse;
    background:
        radial-gradient(circle at 50% 50%, rgba(13, 148, 136, 0.03) 20%, transparent 70%);
}

.hex-3 {
    top: 40%;
    right: 20%;
    width: 150px;
    height: 172px;
    border: 1px dashed rgba(99, 102, 241, 0.1);
    background: transparent;
    animation: floatRotate 20s linear infinite;
}

/* Level 2: Tech Accents (Connecting Lines/Nodes) */
.tech-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    height: 1px;
    width: 100%;
    top: 30%;
    left: 0;
    animation: scanline 8s ease-in-out infinite;
}

@keyframes pulseHex {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes floatRotate {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }

    100% {
        transform: translateY(0) rotate(360deg);
    }
}

@keyframes scanline {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(300px);
        opacity: 0;
    }
}

/* Educational Icon Decorations */
.sidebar::after {
    content: '';
    position: absolute;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--border) 50%, transparent 100%);
}

/* Empty State Illustrations */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.empty-state-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-lg);
    padding: var(--space-xl);
    border-radius: var(--radius-2xl);
    background: linear-gradient(135deg, var(--primary-lightest) 0%, var(--accent-lighter) 100%);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 64px;
    height: 64px;
    stroke-width: 1.5;
}

.empty-state-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.empty-state-description {
    font-size: var(--text-base);
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Achievement Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1;
}

.badge-primary {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.badge-success {
    background: var(--success-light);
    color: var(--accent-dark);
}

.badge-warning {
    background: var(--warning-light);
    color: #92400E;
}

.badge-info {
    background: var(--info-light);
    color: var(--sky);
}

/* Progress Indicators */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: var(--space-sm);
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: var(--space-md);
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    white-space: nowrap;
    z-index: 1000;
    transition: opacity var(--transition-base);
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        padding: var(--space-lg);
    }

    .header-actions h1 {
        font-size: var(--text-3xl);
    }

    .card {
        padding: var(--space-lg);
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: var(--space-md);
    }

    .sidebar::before {
        width: 100%;
        height: 3px;
        top: auto;
        bottom: 0;
        left: 0;
        background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    }

    .sidebar-header {
        margin-bottom: var(--space-md);
        padding-bottom: var(--space-md);
    }

    .nav-links {
        flex-direction: row;
        overflow-x: auto;
        gap: var(--space-xs);
    }

    .nav-item {
        flex-direction: column;
        padding: var(--space-sm);
        gap: var(--space-xs);
        min-width: 80px;
        text-align: center;
        font-size: var(--text-xs);
    }

    .nav-item span {
        font-size: var(--text-xs);
    }

    .nav-icon {
        width: 18px;
        height: 18px;
    }

    .main-content {
        padding: var(--space-md);
    }

    .header-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions h1 {
        font-size: var(--text-2xl);
    }

    .card {
        padding: var(--space-md);
    }

    .data-table {
        font-size: var(--text-sm);
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .modal {
        width: 95%;
        padding: var(--space-lg);
    }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Skip to Main Content */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: var(--space-md);
    text-decoration: none;
    z-index: 9999;
    border-radius: var(--radius-md);
}

.skip-to-main:focus {
    top: var(--space-md);
    left: var(--space-md);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--border);
    }

    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {

    .sidebar,
    .nav-links,
    .btn,
    .modal-overlay {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border);
    }

    .header-actions h1::after {
        display: none;
    }
}

/* ========================================
   EDUCATIONAL THEME ENHANCEMENTS
   ======================================== */

/* Geometric Patterns */
.pattern-dots {
    background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
    background-size: 20px 20px;
}

.pattern-grid {
    background-image:
        linear-gradient(var(--border-light) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-light) 1px, transparent 1px);
    background-size: 30px 30px;
}

/* Learning Achievement Icons */
.achievement-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-lighter) 0%, var(--accent-lighter) 100%);
    color: var(--primary);
    flex-shrink: 0;
}

.achievement-icon svg {
    width: 24px;
    height: 24px;
}

/* Knowledge Cards */
.knowledge-card {
    position: relative;
    overflow: visible;
}

.knowledge-card::before {
    content: '📚';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 2rem;
    opacity: 0.1;
    transform: rotate(15deg);
}

/* Success Indicators */
.success-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--success);
    font-weight: 600;
}

.success-indicator::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    font-size: 12px;
}