/*
Theme Name: Mohammad Roman Portfolio
Theme URI: https://mroman.dev
Author: Mohammad Roman
Author URI: https://mroman.dev
Description: Lightweight, Error-Free, Core Web Vitals 100/100, single scrollbar classic theme.
Version: 18.0.0
Text Domain: roman-portfolio
*/

:root {
    --bg-main: #060913;
    --bg-card: rgba(255, 255, 255, 0.02);
    --border-card: rgba(255, 255, 255, 0.05);
    --primary: #8B5CF6;
    --primary-hover: #7C3AED;
    --secondary: #3B82F6;
}

/* -------------------------------------------------------------
   1. STRICT SINGLE SCROLLBAR (Fixes Dual Scroll Track Bug)
------------------------------------------------------------- */
html {
    scroll-behavior: smooth !important;
    background-color: var(--bg-main) !important;
    overflow-y: scroll !important; /* Forces the ONLY scrollbar here */
    overflow-x: hidden !important;
}

body {
    background-color: var(--bg-main) !important;
    color: #E5E7EB;
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    /* NO OVERFLOW PROPERTIES HERE TO PREVENT DOUBLE SCROLLBAR */
    -webkit-tap-highlight-color: transparent;
    font-family: 'Product Sans', 'Google Sans', system-ui, -apple-system, sans-serif;
}

/* Global WebKit Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #060913;
}
::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* -------------------------------------------------------------
   2. DESKTOP POINTER CURSOR
------------------------------------------------------------- */
@media (min-width: 1024px) {
    body { cursor: default; }
    
    #custom-cursor-dot {
        pointer-events: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 8px;
        height: 8px;
        background-color: #8B5CF6;
        border-radius: 50%;
        z-index: 9999;
        transition: transform 0.08s ease-out;
        transform: translate(-50%, -50%);
    }

    #custom-cursor-ring {
        pointer-events: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 36px;
        height: 36px;
        border: 1.5px solid rgba(139, 92, 246, 0.5);
        border-radius: 50%;
        z-index: 9998;
        transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.25s ease, height 0.25s ease, border-color 0.25s ease;
        transform: translate(-50%, -50%);
    }

    body.cursor-hover #custom-cursor-ring {
        width: 50px;
        height: 50px;
        border-color: rgba(139, 92, 246, 0.9);
        background: rgba(139, 92, 246, 0.08);
    }
}

/* -------------------------------------------------------------
   3. GLASSMORPHISM & UI DESIGN
------------------------------------------------------------- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-card);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 92, 246, 0.12);
}

.glass-card.highlight {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.08), rgba(59, 130, 246, 0.03));
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Glow Orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(90px);
    opacity: 0.5;
    animation: floatGlow 10s ease-in-out infinite alternate;
}
.glow-purple { background: rgba(139, 92, 246, 0.2); width: 400px; height: 400px; }
.glow-blue { background: rgba(59, 130, 246, 0.2); width: 400px; height: 400px; }
.glow-teal { background: rgba(20, 184, 166, 0.15); width: 350px; height: 350px; }

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -30px) scale(1.1); }
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6D28D9 100%);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    border: 1px solid transparent;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #5B21B6 100%);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-outline {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: #C4B5FD;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}
.btn-outline:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

/* -------------------------------------------------------------
   4. ANIMATIONS (Safeguarded against JS Failure)
------------------------------------------------------------- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Failsafe: if JS is disabled or fails to load, content still shows */
html.no-js .fade-in {
    opacity: 1;
    transform: none;
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.1em;
    background-color: var(--primary);
    animation: blink 1s infinite;
    margin-left: 4px;
    position: relative;
    top: 0.15em;
    border-radius: 2px;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.text-gradient {
    background: linear-gradient(to right, #C4B5FD, #8B5CF6, #3B82F6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* -------------------------------------------------------------
   5. COMMENTS & FORMS
------------------------------------------------------------- */
.comments-area { margin-top: 2rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
    width: 100%;
    background-color: rgba(6, 9, 19, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0.75rem !important;
    padding: 0.875rem 1.25rem !important;
    color: #ffffff !important;
    outline: none !important;
    transition: all 0.3s ease !important;
}
.comment-form input:focus, .comment-form textarea:focus {
    border-color: #8B5CF6 !important;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3) !important;
}
.comment-form .form-submit input[type="submit"] {
    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    padding: 0.875rem 2rem !important;
    border-radius: 0.75rem !important;
    cursor: pointer !important;
    border: none !important;
    transition: all 0.3s ease !important;
}

/* -------------------------------------------------------------
   6. MOBILE APP DRAWER
------------------------------------------------------------- */
@media (max-width: 1023px) {
    .mobile-app-menu {
        border-radius: 2rem 2rem 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.95);
    }
}
