@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;600&family=Manrope:wght@300;400;500;600&display=swap');

:root {
    --size: 1.2;

    /* Animation Speeds */
    --transition-fast: 0.15s;
    --transition-medium: 0.3s;
    --transition-slow: 0.5s;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
}

/* Dark Mode (Default) */
:root {
    /* Modern Minimalist Color Scheme - Dark */
    --bg-dark: #0f0f12;
    --bg-darker: #080809;
    --bg-highlight: #1a1a20;
    --fg: #e2e2e6;
    --fg-bright: #ffffff;
    --fg-muted: #a0a0a8;
    --accent-primary: #6e56cf;
    --accent-secondary: #3e63dd;
    --accent-tertiary: #10b981;
    --accent-quaternary: #f59e0b;
    --accent-quinary: #ef4444;
    --border-color: #2a2a35;

    /* Shadows - Dark */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);

    /* Theme-specific variables */
    --theme-bg-pattern-color: rgba(255, 255, 255, 0.01);
    --theme-overlay-bg: rgba(8, 8, 9, 0.85);
    --theme-glow-color: rgba(110, 86, 207, 0.2);
}

/* Light Mode */
:root.light-mode {
    /* Modern Minimalist Color Scheme - Light */
    --bg-dark: #f5f5f7;
    --bg-darker: #e8e8ec;
    --bg-highlight: #ffffff;
    --fg: #1f1f23;
    --fg-bright: #000000;
    --fg-muted: #6e6e76;
    --accent-primary: #6e56cf;
    --accent-secondary: #3e63dd;
    --accent-tertiary: #10b981;
    --accent-quaternary: #f59e0b;
    --accent-quinary: #ef4444;
    --border-color: #d1d1d8;

    /* Shadows - Light */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.04), 0 4px 6px rgba(0, 0, 0, 0.02);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.03), 0 10px 10px rgba(0, 0, 0, 0.02);

    /* Theme-specific variables */
    --theme-bg-pattern-color: rgba(0, 0, 0, 0.01);
    --theme-overlay-bg: rgba(245, 245, 247, 0.85);
    --theme-glow-color: rgba(110, 86, 207, 0.1);
}

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

body {
    background-color: var(--bg-dark);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
    background-image: linear-gradient(135deg, var(--bg-dark), var(--bg-darker));
    color: var(--fg);
    transition: background-color var(--transition-medium) ease;
}

/* Add subtle background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 25% 25%, var(--theme-bg-pattern-color) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, var(--theme-bg-pattern-color) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
    transition: background-image var(--transition-medium) ease;
}

.container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100%;
    transition: all var(--transition-medium) ease;
    position: relative;
    overflow: hidden;
}

.left-section {
    width: 50%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all var(--transition-medium) ease;
    background-color: var(--bg-dark);
}

#header-container {
    height: 25%;
    width: 100%;
    padding: 10px;
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 2;
    transition: all var(--transition-medium) ease;
}

#header-frame {
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden;
    background-color: transparent;
    transition: transform var(--transition-medium) ease;
}

#header-frame:hover {
    transform: scale(1.02);
}

#terminal-container {
    width: 100%;
    height: 75%;
    padding: 20px;
    overflow: hidden;
    background-color: var(--bg-dark);
    position: relative;
    z-index: 1;
    transition: all var(--transition-medium) ease;
}

.right-section {
    width: 50%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-darker);
    border-left: 1px solid var(--border-color);
    position: relative;
    transition: all var(--transition-medium) ease;
    box-shadow: inset 5px 0 15px rgba(0, 0, 0, 0.1);
}

#profile-container {
    height: 40%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    transition: all var(--transition-medium) ease;
    background-color: var(--bg-darker);
    padding: 0;
}

#profile-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        var(--accent-primary),
        transparent
    );
    opacity: 0.5;
}

#stats-container {
    height: 60%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transition: all var(--transition-medium) ease;
}

#vinay-image-frame, #github-stats-frame {
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden;
    background-color: transparent;
    transition: all var(--transition-medium) ease;
    min-height: 100%;
}

#vinay-image-frame {
    filter: none;
    transform: scale(1);
    transition: transform var(--transition-medium) cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
    margin: 0;
    background-color: transparent;
    display: block;
    height: 95%; /* Increase height to 95% of the container */
    min-height: 95%;
}

#vinay-image-frame:hover {
    transform: scale(1.02);
}

#github-stats-frame {
    opacity: 0.95;
    transition: opacity var(--transition-medium) ease;
}

#github-stats-frame:hover {
    opacity: 1;
}

/* Media queries for responsive design */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .left-section, .right-section {
        width: 100%;
        height: 50vh;
    }

    .right-section {
        border-left: none;
        border-top: 2px solid var(--border-color);
        flex-direction: row;
    }

    #profile-container {
        height: 100%;
        width: 50%;
        border-bottom: none;
        border-right: 1px solid var(--border-color);
    }

    #stats-container {
        height: 100%;
        width: 50%;
    }

    #header-container {
        height: 30%;
    }

    #terminal-container {
        height: 70%;
    }
}

@media (max-width: 768px) {
    .left-section {
        height: 70vh;
    }

    .right-section {
        height: 30vh;
        flex-direction: column;
    }

    #profile-container {
        width: 100%;
        height: 100%;
        border-right: none;
        border-bottom: none;
    }

    #stats-container {
        display: none; /* Hide stats container on smaller screens */
    }

    #header-container {
        height: 20%;
    }

    #terminal-container {
        height: 80%;
    }

    /* Show stats command hint in terminal */
    .stats-hint {
        display: block;
    }
}

/* Additional media queries for smaller mobile devices */
@media (max-width: 480px) {
    .left-section {
        height: 70vh;
    }

    .right-section {
        height: 30vh;
    }

    #header-container {
        height: 15%;
    }

    #terminal-container {
        height: 85%;
    }

    .terminal {
        --size: 1;
        padding: 10px;
    }
}

/* For very small screens */
@media (max-width: 360px) {
    .left-section {
        height: 75vh;
    }

    .right-section {
        height: 25vh;
    }

    #header-container {
        height: 12%;
    }

    #terminal-container {
        height: 88%;
    }
}

.terminal {
    --color: var(--fg);
    --background: rgba(15, 15, 18, 0.85);
    --link-color: var(--accent-secondary);
    --size: 1.2;
    --font: 'JetBrains Mono', monospace;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: all var(--transition-medium) ease,
                --color var(--transition-medium) ease,
                --background var(--transition-medium) ease;
    opacity: 0.97;
}

/* Terminal light mode adjustments */
:root.light-mode .terminal {
    --color: var(--fg);
    --background: rgba(245, 245, 247, 0.85);
}

.terminal:hover {
    opacity: 1;
    box-shadow: var(--shadow-xl);
}

.terminal .terminal-output div span {
    display: inline-block;
    transition: color var(--transition-fast) ease;
}

.terminal .cmd {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: 10px;
    transition: border-color var(--transition-medium) ease;
}

.terminal a {
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-secondary);
    padding-bottom: 1px;
    transition: all var(--transition-fast) ease;
}

.terminal a:hover {
    color: var(--accent-secondary) !important;
    border-bottom: 1px solid var(--accent-secondary);
}

/* Bold text styling */
.terminal .terminal-output div span[style*="font-weight: bold"],
.terminal .terminal-output div span[style*="font-weight:bold"] {
    color: var(--accent-tertiary);
    font-weight: 600 !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast) ease;
}

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

/* Animation for the prompt */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.terminal .cmd .cursor.blink {
    animation: blink 1s infinite;
    color: var(--accent-primary);
    border-radius: 1px;
    transition: background-color var(--transition-fast) ease;
}

/* Command prompt styling */
.terminal .prompt {
    font-weight: 500;
    letter-spacing: -0.02em;
}

/* Add a subtle glow effect to the terminal using a pseudo-element for better performance */
.terminal {
    position: relative;
}

.terminal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-lg);
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
    animation: pulse-glow 8s infinite ease-in-out;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

:root:not(.light-mode) .terminal::after {
    box-shadow: 0 0 30px var(--theme-glow-color);
}

:root.light-mode .terminal::after {
    box-shadow: 0 0 20px var(--theme-glow-color);
}

/* GitHub Stats Overlay */
.stats-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--theme-overlay-bg);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-medium) ease,
                visibility var(--transition-medium) ease,
                background-color var(--transition-medium) ease;
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
}

.stats-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.stats-overlay iframe {
    width: 95%;
    height: 95%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    background-color: var(--bg-dark);
    transform: translateY(20px);
    opacity: 0;
    transition: transform var(--transition-medium) cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity var(--transition-medium) ease;
}

.stats-overlay.visible iframe {
    transform: translateY(0);
    opacity: 1;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--bg-highlight);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-full);
    color: var(--accent-primary);
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1001;
    transition: all var(--transition-medium) ease;
    transform: scale(0.9) rotate(-90deg);
    opacity: 0;
    box-shadow: var(--shadow-md);
}

.stats-overlay.visible .close-btn {
    transform: scale(1) rotate(0);
    opacity: 1;
    transition-delay: 0.2s;
}

.close-btn:hover {
    background-color: var(--accent-primary);
    color: var(--fg-bright);
    transform: scale(1.1) rotate(90deg);
    box-shadow: var(--shadow-lg), 0 0 15px rgba(110, 86, 207, 0.4);
}

/* Stats hint for mobile */
.stats-hint {
    display: none;
    margin: 15px 0;
    padding: 12px 15px;
    background-color: var(--bg-highlight);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-primary);
    font-size: 0.9em;
    color: var(--fg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: var(--shadow-sm);
    transform: translateY(0);
    transition: all var(--transition-medium) cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.stats-hint::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom,
        var(--accent-primary),
        var(--accent-secondary)
    );
    opacity: 0.8;
}

.stats-hint:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stats-hint code {
    background-color: rgba(8, 8, 9, 0.5);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    color: var(--accent-tertiary);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    transition: all var(--transition-fast) ease;
}

.stats-hint code:hover {
    background-color: rgba(8, 8, 9, 0.7);
    color: var(--accent-quaternary);
}

/* Theme Toggle Button */
#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

#theme-toggle-btn {
    background-color: var(--bg-highlight);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--fg);
    transition: all var(--transition-medium) ease;
    box-shadow: var(--shadow-md);
    outline: none;
    padding: 0;
}

#theme-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

#theme-toggle-btn:active {
    transform: translateY(0);
}

#sun-icon, #moon-icon {
    position: absolute;
    transition: all var(--transition-medium) ease;
}

:root.light-mode #sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

:root.light-mode #moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

:root:not(.light-mode) #sun-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

:root:not(.light-mode) #moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}