/* CSS Variables for Theme */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-hover-bg: rgba(255, 255, 255, 0.85);
    --card-bg: #ffffff;
    --scrollbar-track: #f1f1f1;
    --scrollbar-thumb: #888;
    --scrollbar-thumb-hover: #555;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --blob-1: rgb(196, 181, 253);
    --blob-2: rgb(253, 224, 71);
    --blob-3: rgb(251, 207, 232);
}

.dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-hover-bg: rgba(30, 41, 59, 0.9);
    --card-bg: #1e293b;
    --scrollbar-track: #1e293b;
    --scrollbar-thumb: #475569;
    --scrollbar-thumb-hover: #64748b;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --blob-1: rgb(99, 102, 241, 0.3);
    --blob-2: rgb(251, 191, 36, 0.3);
    --blob-3: rgb(236, 72, 153, 0.3);
}

/* Smooth theme transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.gradient-text {
    background: linear-gradient(to right, #6366f1, #ec4899);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

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

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

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.glass-card:hover {
    transform: translateY(-12px) rotateX(5deg);
    box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.25), 0 0 0 1px rgba(99, 102, 241, 0.1);
    background: var(--glass-hover-bg);
}

.skill-icon {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover .skill-icon {
    transform: scale(1.1) translateZ(20px);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.skill-card {
    transition: all 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
}

.skill-pill {
    transition: all 0.2s ease;
}

.skill-pill:hover {
    transform: scale(1.05);
}

.ide-window {
    box-shadow: 0 20px 50px -12px var(--shadow-color);
}

.ide-sidebar-item {
    border-left: 2px solid transparent;
}

.ide-sidebar-item.active {
    background-color: #37373d;
    border-left-color: #6366f1;
    color: white;
}

.code-line {
    counter-increment: line;
}

.code-line::before {
    content: counter(line);
    display: inline-block;
    width: 2rem;
    margin-right: 1rem;
    text-align: right;
    color: #6e7681;
}

.typing-cursor::after {
    content: '|';
    animation: blink 1s step-start infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.skill-card-modern {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.skill-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.3);
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 1s ease-in-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Theme Toggle Button */
.theme-toggle {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--glass-hover-bg);
}

.theme-toggle i {
    font-size: 20px;
    color: var(--text-primary);
    transition: transform 0.5s ease;
}

.theme-toggle:active i {
    transform: rotate(360deg);
}

/* Dark mode blob colors */
.dark .bg-purple-300 {
    background-color: var(--blob-1) !important;
}

.dark .bg-yellow-300 {
    background-color: var(--blob-2) !important;
}

.dark .bg-pink-300 {
    background-color: var(--blob-3) !important;
}

/* Form Input Styles for Dark Mode */
input[type="text"],
input[type="email"],
textarea {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.dark input[type="text"],
.dark input[type="email"],
.dark textarea {
    background-color: var(--bg-tertiary);
}

/* Animated Code Window */
.code-line {
    opacity: 0;
    animation: fadeInCode 0.5s ease-out forwards;
}

.code-line:nth-child(1) {
    animation-delay: 0.1s;
}

.code-line:nth-child(2) {
    animation-delay: 0.2s;
}

.code-line:nth-child(3) {
    animation-delay: 0.3s;
}

.code-line:nth-child(4) {
    animation-delay: 0.4s;
}

.code-line:nth-child(5) {
    animation-delay: 0.6s;
}

.code-line:nth-child(6) {
    animation-delay: 0.8s;
}

.code-line:nth-child(7) {
    animation-delay: 1s;
}

.code-line:nth-child(8) {
    animation-delay: 1.2s;
}

.code-line:nth-child(9) {
    animation-delay: 1.4s;
}

.code-line:nth-child(10) {
    animation-delay: 1.6s;
}

.code-line:nth-child(11) {
    animation-delay: 1.8s;
}

.code-line:nth-child(12) {
    animation-delay: 2s;
}

@keyframes fadeInCode {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

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

.cursor-blink {
    animation: blink 1s step-start infinite;
    color: var(--text-primary);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

#code-container {
    color: var(--text-primary);
}

/* Code editor theme - dark in light mode, white in dark mode */
.code-window {
    background-color: #1e293b !important;
}

.dark .code-window {
    background-color: #ffffff !important;
}

.code-window-header {
    background-color: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
}

.dark .code-window-header {
    background-color: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.code-window #code-container {
    color: #e2e8f0 !important;
}

.dark .code-window #code-container {
    color: #0f172a !important;
}

.code-window .cursor-blink {
    color: #e2e8f0 !important;
}

.dark .code-window .cursor-blink {
    color: #0f172a !important;
}

/* Update code syntax colors in dark mode for better contrast on white background */
.dark .code-window .text-purple-500 {
    color: #7c3aed !important;
}

.dark .code-window .text-blue-400 {
    color: #2563eb !important;
}

.dark .code-window .text-green-400 {
    color: #16a34a !important;
}

.dark .code-window .text-blue-300 {
    color: #3b82f6 !important;
}

.dark .code-window .text-gray-400 {
    color: #64748b !important;
}

.dark .code-window .text-green-300 {
    color: #22c55e !important;
}

.dark .code-window-header .text-slate-400 {
    color: #64748b !important;
}

/* Disable text selection site-wide */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow selection in form inputs */
input,
textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Form Status Styles */
#form-status {
    transition: all 0.3s ease;
}

#success-msg, #error-msg {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}
