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

:root {
    --bg-light: #f0f2f5;
    --card-light: #ffffff;
    --text-light: #1c1e21;
    --muted-light: #65676b;
    --accent-light: #007bff;

    --bg-dark: #121212;
    --card-dark: #1e1e1e;
    --text-dark: #e4e6eb;
    --muted-dark: #b0b3b8;
    --accent-dark: #00c6ff;
    --accent-yt: #ff3b30;

    --radius: 20px;
    --container-w: 1200px;
}

/* Default (light) */
:root[data-theme="light"] {
    --bg: var(--bg-light);
    --card: var(--card-light);
    --text: var(--text-light);
    --muted: var(--muted-light);
    --border: rgba(13, 18, 23, 0.06);
}

/* Dark theme */
:root[data-theme="dark"] {
    --bg: var(--bg-dark);
    --card: var(--card-dark);
    --text: var(--text-dark);
    --muted: var(--muted-dark);
    --border: rgba(255, 255, 255, 0.04);
    --header-bg: #2a2a2a;
}

:root[data-theme="light"] {
    --header-bg: var(--card-dark);
}

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
            transition: background-color 0.5s ease, color 0.5s ease;
        }

        /* Preloader Styles */
        .preloader {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--bg); /* Use theme background */
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            transition: opacity 0.7s ease-out;
        }

        .preloader.hidden {
            opacity: 0;
            visibility: hidden;
        }

        .spinner {
            border: 4px solid rgba(0, 0, 0, 0.1);
            border-top: 4px solid #3498db; /* Spinner color */
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }

        .portfolio-card {
            background: var(--card);
            border-radius: 20px;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            transform: translateZ(0);
            will-change: transform;
            border: 1px solid var(--border);
            transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
        }

.theme-switch-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s transform;
}

.slider:before {
    position: absolute;
    content: "☀️";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s transform, .4s background-color;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transform: rotate(0deg) scale(1);
}

input:checked+.slider {
    background-color: var(--accent-yt);
}

input:checked+.slider:before {
    content: "🌙";
    transform: translateX(26px) rotate(360deg) scale(1.1);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}



        .header {
            background: var(--header-bg);
            color: var(--text-dark);
            padding: 40px 30px;
            text-align: center;
            position: relative;
            overflow: hidden;
            transition: background 0.5s ease, color 0.5s ease;
        }









        .profile-img {
            width: 180px;
            height: 180px;
            border-radius: 50%;
            border: 4px solid white;
            margin: 0 auto 20px;
            background: linear-gradient(45deg, #f39c12, #e74c3c);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 48px;
            color: white;
            position: relative;
            z-index: 1;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        }

        .name {
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 10px;
            position: relative;
            z-index: 1;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
            transition: color 0.5s ease;
        }

        .subtitle {
            font-size: 1.2rem;
            opacity: 0.9;
            position: relative;
            z-index: 1;
            transition: color 0.5s ease;
        }

        .content {
            padding: 40px 30px;
        }

        .section {
            margin-bottom: 40px;
        }

        .section:last-of-type {
            margin-bottom: 0;
        }

        .section-title {
            font-size: 1.8rem;
            color: var(--text);
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
            transition: color 0.5s ease;
        }

        .section-title i {
            color: #3498db;
        }

        .social-links {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 15px;
            margin-top: 20px;
        }

        .social-link {
            display: flex;
            align-items: center;
            padding: 12px 15px;
            border-radius: 12px;
            text-decoration: none;
            color: white !important;
            font-weight: 500;
            transition: all 0.3s ease;
            border: none;
            position: relative;
            overflow: hidden;
            user-select: none;
            transform: translateY(0) scale(1);
            margin: 6px 0;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }

        .social-link.facebook {
            background: linear-gradient(135deg, #1877f2, #42a5f5);
        }

        .social-link.instagram {
            background: linear-gradient(135deg, #e4405f, #f77737);
        }

        .social-link.website {
            background: linear-gradient(135deg, #27ae60, #2ecc71);
        }

        .social-link.whatsapp {
            background: linear-gradient(135deg, #25d366, #128c7e);
        }

        .social-link.youtube {
            background: linear-gradient(135deg, #ff0000, #cc0000);
        }

        .social-link.linkedin {
            background: linear-gradient(135deg, #0077b5, #005885);
        }

        .social-link.telegram {
            background: linear-gradient(135deg, #0088cc, #229ed9);
        }

        .social-link::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
            transition: left 0.6s ease;
        }

        .social-link:active {
            transform: scale(0.98);
        }

        .social-link i {
            position: relative;
        }

        .social-link span {
            transition: all 0.3s ease;
            z-index: 1;
            position: relative;
        }

        /* FOSS Project Links Styling */
        .social-link.foss-project {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            padding: 12px 15px;
            border-radius: 12px;
            text-align: center;
            font-weight: 600;
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            margin: 6px 0;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
            display: flex;
            align-items: center;
            justify-content: flex-start;
        }

        .social-link.foss-project:active {
            transform: scale(0.95);
            filter: brightness(0.95);
            box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
        }

        .social-link.foss-project i {
            font-size: 1.2rem;
            margin-right: 12px;
            width: auto;
        }

        /* Mobile View Adjustments for FOSS Projects */
        @media (max-width: 768px) {
            .social-links {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .social-link {
                padding: 12px 15px;
                font-size: 0.95rem;
                margin: 6px 0;
            }

            .social-link i {
                font-size: 1.2rem;
                margin-right: 10px;
            }
        }

        @media (max-width: 480px) {
            .social-link {
                padding: 10px 12px;
                font-size: 0.9rem;
            }

            .social-link i {
                font-size: 1.1rem;
                margin-right: 8px;
            }
        }

        .social-link i {
            font-size: 1.5rem;
            margin-right: 15px;
            width: 30px;
            text-align: center;
        }

        .about {
            background: var(--bg);
            padding: 25px;
            border-radius: 12px;
            border-left: 4px solid #3498db;
            transition: background 0.5s ease;
        }

        .skills {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .skill {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            padding: 15px 20px;
            border-radius: 25px;
            text-align: center;
            font-weight: 600;
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            margin: 5px 0;
        }

        .contact-info {
            background: var(--header-bg);
            color: var(--text-dark);
            padding: 25px;
            border-radius: 12px;
            text-align: center;
            word-spacing: 2px;
            transition: background 0.5s ease, color 0.5s ease;
        }

        .contact-buttons {
            display: flex;
            justify-content: center;
            gap: 12px;
            margin: 15px 0;
            flex-wrap: wrap;
        }

        .contact-btn i {
            margin-right: 6px;
            font-size: 0.9rem;
        }

        .contact-btn {
            color: white;
            text-decoration: none;
            padding: 8px 12px;
            border-radius: 8px;
            background: #000000;
            display: inline-flex;
            align-items: center;
            font-weight: 500;
            font-size: 0.9rem;
            min-width: 110px;
            justify-content: center;
            margin: 3px;
            
        }

        .contact-btn:active {
            transform: scale(0.98);
        }

        .footer {
            text-align: center;
            padding: 20px;
            color: var(--muted);
            font-size: 0.9rem;
        }

        /* Mobile Responsive */
        @media (max-width: 768px) {
            .container {
                padding: 10px;
            }

            .header {
                padding: 30px 20px;
            }

            .name {
                font-size: 2rem;
            }

            .subtitle {
                font-size: 1rem;
            }

            .content {
                padding: 30px 20px;
            }

            .section-title {
                font-size: 1.5rem;
            }

            .social-links {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .social-link {
                padding: 12px 15px;
                touch-action: manipulation;
                -webkit-touch-callout: none;
                -webkit-tap-highlight-color: transparent;
            }

            .social-link i {
                font-size: 1.3rem;
                margin-right: 12px;
            }

            /* Disable scale transforms on mobile */
            .social-link:active {
                transform: none;
                opacity: 0.8;
            }

            /* Contact buttons responsive */
            .contact-buttons {
                flex-direction: row;
                gap: 10px;
            }

            .contact-btn {
                padding: 6px 12px;
                font-size: 0.85rem;
                min-width: 110px;
            }

            .profile-img {
                width: 160px;
                height: 160px;
                font-size: 40px;
            }

            .skills {
                grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            }

        }

        @media (max-width: 480px) {
            .header {
                padding: 25px 15px;
            }

            .name {
                font-size: 1.8rem;
            }

            .content {
                padding: 25px 15px;
            }

            .social-link {
                padding: 10px 12px;
                font-size: 0.9rem;
            }

            .profile-img {
                width: 160px;
                height: 160px;
                font-size: 32px;
            }

            /* Optimized mobile touch interactions */
            .social-link:active,
            .skill:active,
            .contact-btn:active,
            .foss-project:active {
                transform: none !important;
                opacity: 0.8;
            }

            /* Add touch optimizations for all interactive elements */
            .social-link,
            .skill,
            .contact-btn,
            .foss-project {
                touch-action: manipulation;
                -webkit-touch-callout: none;
                -webkit-tap-highlight-color: transparent;
            }

            /* Smaller contact buttons for mobile */
            .contact-buttons {
                gap: 8px;
            }

            .contact-btn {
                padding: 6px 10px;
                font-size: 0.8rem;
                min-width: 100px;
                border-radius: 15px;
            }
        }



        /* FOSS Projects Styling */
        .foss-projects {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 15px;
            margin-top: 20px;
        }

        .foss-project {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border-radius: 12px;
            text-align: center;
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            margin: 5px 0;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
            width: 100%;
        }

        .foss-project a {
            color: white;
            text-decoration: none;
            padding: 12px 15px;
            font-weight: 600;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            width: 100%;
            height: 100%;
        }

        .foss-project:active {
            transform: scale(0.98);
        }

        .foss-project i {
            font-size: 1.2rem;
            margin-right: 12px;
        }

        /* Mobile styles for FOSS Projects */
        @media (max-width: 768px) {
            .foss-projects {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .foss-project {
                margin: 0;
            }

            .foss-project a {
                padding: 12px 15px;
                font-size: 0.95rem;
                justify-content: flex-start;
            }
        }

        @media (max-width: 480px) {
            .foss-projects {
                gap: 10px;
            }

            .foss-project a {
                padding: 10px 12px;
                font-size: 0.9rem;
            }

            .foss-project i {
                font-size: 1.1rem;
                margin-right: 10px;
            }
        }

@media (hover: hover) {
    .social-link:hover {
        opacity: 0.9;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        color: white;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .social-link.foss-project:hover {
        filter: brightness(1.1);
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
        transform: translateY(-2px);
    }

    .social-link.telegram:hover {
        background: linear-gradient(135deg, #0088cc, #229ed9);
        color: white;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .skill:hover {
        opacity: 0.9;
    }

    .contact-btn:hover {
        opacity: 0.9;
        background: #222222;
    }

    .foss-project:hover {
        opacity: 0.9;
    }
}
