/* ==========================================================================
   ShadmanIT Portfolio & CMS — Master UI Stylesheet
   ========================================================================== */

:root {
    --brand-primary: #dc2626;
    --brand-accent: #ef4444;
    --brand-dark: #06070a;
    --brand-card: rgba(10, 11, 16, 0.85);
    --brand-border: rgba(255, 255, 255, 0.08);
    --mouse-x: 50%;
    --mouse-y: 50%;
}

/* Base Body Styles */
html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    background-color: #06070a;
    color: #f1f5f9;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

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

::-webkit-scrollbar-track {
    background: #06070a;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 9999px;
    border: 2px solid #06070a;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #dc2626;
}

/* ==========================================================================
   Global Cursor Glow Card Interaction System
   ========================================================================== */
.glow-card {
    position: relative;
    isolation: isolate;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.3s ease, 
                box-shadow 0.3s ease;
}

.glow-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: radial-gradient(
        450px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(220, 38, 38, 0.13),
        transparent 45%
    );
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: 0;
}

.glow-card > * {
    position: relative;
    z-index: 1;
}

.glow-card:hover::before {
    opacity: 1;
}

.glow-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.7), 
                0 0 25px -5px rgba(220, 38, 38, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
}

/* Desktop Subtle Tilt Card */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* ==========================================================================
   Scroll Reveal System
   ========================================================================== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Desktop Floating Dock
   ========================================================================== */
.dock-item {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-item.is-active {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(254, 202, 202, 0.4) !important;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-2px) scale(1.06);
}

.dock-item.is-active .dock-active-dot {
    opacity: 1 !important;
    background: #ffffff !important;
    box-shadow: 0 0 6px #ffffff;
}

.dock-item.is-active .dock-icon svg {
    color: #ffffff !important;
    transform: scale(1.1);
}

/* ==========================================================================
   Mobile Bottom Navigation & Sliding Sheet
   ========================================================================== */
.mobile-nav-link {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-link.is-active {
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.25) 0%, rgba(185, 28, 28, 0.2) 100%) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    border-radius: 0.75rem;
}

.mobile-nav-link.is-active .mobile-active-indicator {
    opacity: 1 !important;
    box-shadow: 0 0 10px #ef4444;
}

.mobile-nav-link.is-active svg {
    color: #ef4444 !important;
    transform: scale(1.1);
}

.drawer-link.is-active {
    background: rgba(220, 38, 38, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.45) !important;
    color: #ffffff !important;
}

.drawer-link.is-active span:first-child {
    background: #ef4444 !important;
    box-shadow: 0 0 8px #ef4444;
}

/* ==========================================================================
   Section Animation Presets (A - F)
   ========================================================================== */

/* Preset A (Hero): Cinematic fade, stagger, and ambient border glow */
.anim-preset-a .hero-headline {
    background-size: 200% auto;
    animation: textShimmer 6s linear infinite;
}

@keyframes textShimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Preset B (Services / What I Do): Staggered card lift + subtle red halo */
.anim-preset-b .reveal-on-scroll.is-revealed .glow-card:nth-child(1) { transition-delay: 0.05s; }
.anim-preset-b .reveal-on-scroll.is-revealed .glow-card:nth-child(2) { transition-delay: 0.12s; }
.anim-preset-b .reveal-on-scroll.is-revealed .glow-card:nth-child(3) { transition-delay: 0.19s; }
.anim-preset-b .reveal-on-scroll.is-revealed .glow-card:nth-child(4) { transition-delay: 0.26s; }

/* Preset C (Projects / Work): Image zoom-reveal on enter + badge slide-in */
.anim-preset-c .project-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}
.anim-preset-c .project-card img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.anim-preset-c .project-card:hover img {
    transform: scale(1.05);
}
.anim-preset-c .reveal-on-scroll.is-revealed .project-badge {
    animation: badgeSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes badgeSlideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Preset D (Experience): Progressive vertical timeline growth */
.anim-preset-d .timeline-node-dot.is-passed {
    border-color: #ef4444 !important;
    background-color: #ef4444 !important;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.8) !important;
    transform: translate(-50%, 0) scale(1.15) !important;
}

/* Preset E (Stats / Counters): Ambient glow & stat card lift */
.stat-counter {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* Preset F (Contact): Channel card pulse + submit button state */
.anim-preset-f .glow-card {
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.anim-preset-f .glow-card:hover {
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.7), 0 0 20px -3px rgba(220, 38, 38, 0.2);
}

/* ==========================================================================
   Desktop Custom Cursor
   ========================================================================== */
#custom-cursor-dot {
    pointer-events: none;
    will-change: transform;
}

#custom-cursor-ring {
    pointer-events: none;
    will-change: transform, width, height;
    transition: transform 0.12s ease-out, border-color 0.2s ease, background-color 0.2s ease;
}

body.cursor-hover #custom-cursor-ring {
    transform: translate(-50%, -50%) scale(1.6);
    border-color: rgba(239, 68, 68, 0.6);
    background-color: rgba(220, 38, 38, 0.08);
}

/* ==========================================================================
   Skills Filter & Category Toggles
   ========================================================================== */
.skill-tab-btn.active {
    background-color: #dc2626 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.skill-category-group {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.skill-category-group.is-hidden {
    display: none;
}

/* Utility Helpers */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Touch & Reduced-Motion Adaptations */
@media (hover: none) and (pointer: coarse) {
    .glow-card::before {
        display: none !important;
    }
    .glow-card:hover {
        transform: none !important;
    }
    #custom-cursor-dot,
    #custom-cursor-ring {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
    .glow-card:hover {
        transform: none !important;
    }
    #custom-cursor-dot,
    #custom-cursor-ring {
        display: none !important;
    }
}

/* Desktop Floating Dock Refinements */
.dock-item {
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-item:hover {
    transform: translateY(-1px);
}

.dock-item.is-active {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(254, 202, 202, 0.35) !important;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.55), 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    transform: translateY(-1px);
}

.dock-item.is-active .dock-icon {
    color: #ffffff !important;
    transform: scale(1.08);
}

.dock-item.is-active .dock-chevron {
    color: #ffffff !important;
}

.dock-more-item.is-active {
    background: rgba(220, 38, 38, 0.18) !important;
    color: #ffffff !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

.dock-more-item.is-active .dock-icon {
    color: #ef4444 !important;
}

/* Print Styles */
@media print {
    #floating-dock,
    #mobile-nav-bar,
    #mobile-drawer,
    header,
    footer,
    #contact-form,
    #scroll-progress {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

/* Layout repairs for narrow phones and keyboard users. */
html { scroll-padding-top: 24px; }
main, section, .grid > *, .flex > * { min-width: 0; }
main { overflow-wrap: anywhere; }
img, video, iframe { max-width: 100%; }
a:focus-visible, button:focus-visible { outline: 2px solid #ef4444; outline-offset: 4px; }
.reveal-on-scroll.is-revealed { will-change: auto; }
body[data-animations="0"] .reveal-on-scroll { opacity: 1; transform: none; }
body { cursor: auto !important; }
a, button, [role="button"] { cursor: pointer !important; }
#custom-cursor-dot, #custom-cursor-ring { display: none !important; }
@media (max-width: 639px) {
    section.py-28 { padding-top: 4rem; padding-bottom: 4rem; }
    #experience .timeline-node-item { padding-left: 1.75rem; }
    #experience .glow-card { padding: 1rem; }
    #experience .glow-card .flex.items-center.gap-2 { flex-wrap: wrap; }
    #experience .timeline-node-dot, #experience-timeline-line { left: .5rem; }
    #experience-timeline-container > .absolute { left: .5rem; }
    header img { max-width: 65vw; }
    footer { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
}
@media (hover: none), (pointer: coarse) {
    .glow-card:hover { transform: none; }
    .glow-card { backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .reveal-on-scroll { opacity: 1 !important; transform: none !important; }
}

.skills-filter-scroll { max-width:100%; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; scrollbar-width:thin; scrollbar-color:#52525b transparent; }
.skills-filter-list { width:max-content; min-width:max-content; }
.skill-tab-btn { flex:0 0 auto; white-space:nowrap; overflow-wrap:normal; min-height:44px; }
.skill-category-group[hidden] { display:none !important; }

/* Consistent filled organization/institution logos and PNG transparency backing. */
img[src*=".png" i] { background-color: #fff; }
#experience img,
#education img,
#experience-sortable-body img,
#education-sortable-body img,
#org_logo_preview img,
#edu_logo_preview img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    object-fit: cover;
    background-color: #fff;
}
#experience div:has(> img),
#education div:has(> img),
#org_logo_preview,
#edu_logo_preview {
    padding: 0;
    overflow: hidden;
}
