/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --color-primary: #008080;
    --color-primary-light: #00CCCC;
    --color-primary-lighter: #4DFFFF;
    --color-secondary: #5755D9;
    --color-accent: #FF6654;
    --color-background-light: #F5F5F5;
    --color-background-dark: #353839;
    --color-text-main: #353839;
    --color-text-white: #ffffff;
}

body {
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
}

/* Material Symbols */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-light);
}

/* =========================================
   2. COMPONENT STYLES
   ========================================= */

/* Gradient Border for Avatar */
.gradient-border {
    position: relative;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light), var(--color-primary-lighter));
    padding: 4px;
    border-radius: 9999px;
}

.gradient-border-inner {
    background: white;
    border-radius: 9999px;
}

.dark .gradient-border-inner {
    background: #0f172a;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 40;
}

.dark .mobile-menu {
    background: var(--color-background-dark);
    border-bottom-color: #1e293b;
}

.mobile-menu.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.mobile-menu nav a {
    padding: 0.75rem 2rem;
    border-bottom: 1px solid #f3f4f6;
}

.dark .mobile-menu nav a {
    border-bottom-color: #4b5563;
}

/* Mobile Theme Toggle Button */
.mobile-menu nav button {
    width: 100%;
    text-align: left;
    padding: 0.75rem 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
}

.dark .mobile-menu nav button {
    border-top-color: #4b5563;
}

/* Hamburger Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 50;
}

.hamburger-btn span {
    width: 25px;
    height: 3px;
    background-color: var(--color-text-main);
    margin: 3px 0;
    transition: 0.4s;
    border-radius: 2px;
}

.dark .hamburger-btn span {
    background-color: #f1f5f9;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }
}

/* =========================================
   3. ANIMATIONS & EFFECTS
   ========================================= */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Go to Top Button */
#go-to-top.visible {
    transform: translateY(0);
    opacity: 1;
}

/* Hover Lift */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 128, 128, 0.15);
}

/* Counter Pulse */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.counter {
    display: inline-block;
    transition: all 0.3s ease;
}

.counter.counted {
    animation: pulse 0.5s ease-in-out;
}

/* Link Underline Animation */
a:not(.btn):not(.tab-btn):not(.no-underline) {
    position: relative;
    text-decoration: none;
}

a:not(.btn):not(.tab-btn):not(.no-underline)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

a:not(.btn):not(.tab-btn):not(.no-underline):hover::after {
    width: 100%;
}

/* Spinning Loader */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* =========================================
   4. TABS & TABLES
   ========================================= */

.tab-btn {
    cursor: pointer;
}

.tab-content {
    display: none;
    animation: fadeInTab 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#network-container {
    position: relative;
    overflow: hidden;
}

/* Range Slider Styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    outline: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.dark input[type="range"] {
    background: #334155;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.dark input[type="range"]::-webkit-slider-thumb {
    border-color: #0f172a;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--color-primary-light);
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.dark input[type="range"]::-moz-range-thumb {
    border-color: #0f172a;
}

input[type="range"]::-moz-range-thumb:hover {
    background: var(--color-primary-light);
    transform: scale(1.1);
}

/* =========================================
   5. UTILITIES
   ========================================= */

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 128, 128, 0.05);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 128, 128, 0.1), 0 4px 6px -2px rgba(0, 128, 128, 0.05);
}

.focus-visible:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* =========================================
   6. PRINT STYLES
   ========================================= */
@media print {

    /* Hide non-essential elements */
    header,
    footer,
    .hamburger-btn,
    #theme-toggle,
    #mobileMenu,
    .no-print,
    button {
        display: none !important;
    }

    /* Reset Body */
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }

    /* Expand Sections */
    .tab-content {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
        margin-bottom: 20px;
    }

    .tab-btn {
        display: none;
    }

    #teaching-full {
        display: block !important;
    }

    #teaching-preview {
        display: none !important;
    }

    /* Grid Adjustments */
    .grid {
        display: block !important;
    }

    .col-span-12,
    .md\:col-span-7,
    .md\:col-span-5 {
        width: 100% !important;
    }

    /* Remove Shadows and Backgrounds */
    .bg-white,
    .dark\:bg-slate-900 {
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        margin-bottom: 1cm;
    }

    /* Page Breaks */
    article,
    section,
    .card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Links */
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    a[href^="#"]::after {
        content: "";
    }
}