/*
 * Waeyuk Modern Design System - Night Black (OLED-Ready)
 * v2.0 — Strategic Refactor Phase
 */

:root {
    /* =============================================
     * COLORS — Deep OLED Palette
     * ============================================= */
    --bg-main: #000000;
    --bg: var(--bg-main);
    --bg-surface: #0a0a0a;
    --bg-elevated: #121212;
    --bg-overlay: rgba(0, 0, 0, 0.7);

    --tx-primary: #ffffff;
    --tx-secondary: #94a3b8;
    --tx-muted: #64748b;
    --tx-disabled: #334155;

    --accent: #00d2ff;
    --accent-secondary: #9933ff;
    --accent-hover: #00b8e0;
    --accent-glow: rgba(0, 210, 255, 0.4);
    --accent-glow-sm: rgba(0, 210, 255, 0.2);

    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);
    --border-subtle: rgba(255, 255, 255, 0.06);

    --glass: rgba(20, 20, 25, 0.65);
    --glass-bright: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-surface: rgba(255, 255, 255, 0.03);

    --gradient-primary: linear-gradient(135deg, #00d2ff, #9933ff);
    --gradient-surface: linear-gradient(135deg, rgba(0,210,255,0.05), rgba(153,51,255,0.05));

    /* Semantic Colors */
    --success: #00ff88;
    --success-bg: rgba(0, 255, 136, 0.1);
    --success-glow: rgba(0, 255, 136, 0.3);
    --info: #00d2ff;
    --info-bg: rgba(0, 210, 255, 0.1);
    --info-glow: rgba(0, 210, 255, 0.3);
    --warning: #ffcc00;
    --warning-bg: rgba(255, 204, 0, 0.1);
    --warning-glow: rgba(255, 204, 0, 0.3);
    --error: #ff3366;
    --error-bg: rgba(255, 51, 102, 0.1);
    --error-glow: rgba(255, 51, 102, 0.3);

    /* =============================================
     * SPACING SYSTEM — 4px base unit
     * ============================================= */
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  20px;
    --space-6:  24px;
    --space-8:  32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;
    --space-24: 96px;

    /* =============================================
     * TYPOGRAPHY SCALE
     * ============================================= */
    --text-xs:   0.75rem;    /* 12px */
    --text-sm:   0.875rem;   /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg:   1.125rem;   /* 18px */
    --text-xl:   1.25rem;    /* 20px */
    --text-2xl:  1.5rem;     /* 24px */
    --text-3xl:  1.875rem;   /* 30px */
    --text-4xl:  2.25rem;    /* 36px */
    --text-5xl:  3rem;       /* 48px */

    --fw-normal:   400;
    --fw-medium:   500;
    --fw-semibold: 600;
    --fw-bold:     700;
    --fw-black:    900;

    --leading-tight:  1.1;
    --leading-snug:   1.3;
    --leading-normal: 1.6;
    --leading-relaxed: 1.75;

    /* =============================================
     * BORDER RADIUS SYSTEM
     * ============================================= */
    --radius-xs:   4px;
    --radius-sm:   8px;
    --radius-md:   16px;
    --radius-lg:   24px;
    --radius-xl:   32px;
    --radius-2xl:  48px;
    --radius-full: 9999px;

    /* =============================================
     * SHADOW / ELEVATION SYSTEM
     * ============================================= */
    --shadow-xs:  0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-sm:  0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md:  0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg:  0 20px 50px rgba(0, 0, 0, 0.6);
    --shadow-xl:  0 40px 80px rgba(0, 0, 0, 0.7);
    --shadow-glow:        0 0 20px var(--accent-glow);
    --shadow-glow-sm:     0 0 10px var(--accent-glow-sm);
    --shadow-glow-purple: 0 0 20px rgba(153, 51, 255, 0.4);

    /* =============================================
     * TRANSITIONS
     * ============================================= */
    --transition-fast:   all 0.15s ease;
    --transition:        all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:   all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* =============================================
     * Z-INDEX SCALE
     * ============================================= */
    --z-base:     0;
    --z-raised:   10;
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-overlay:  500;
    --z-modal:    1000;
    --z-popup:    1500;
    --z-toast:    2000;
    --z-top:      9999;
}

body {
    background-color: var(--bg-main);
    color: var(--tx-primary);
    font-family: 'Tajawal', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass-card:hover {
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-5px);
}

/* Moving Glow Border Component */
.glow-border {
    position: relative;
}

.glow-border::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(45deg, var(--accent), var(--accent-secondary), var(--accent));
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    z-index: 2;
    animation: borderMovingGlow 3s linear infinite;
    pointer-events: none;
}

@keyframes borderMovingGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Mouse-following Glow */
.interactive-glow {
    position: relative;
}

.interactive-glow::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        600px circle at var(--mouse-x, 0) var(--mouse-y, 0),
        rgba(255, 255, 255, 0.06),
        transparent 40%
    );
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}

.interactive-glow:hover::after {
    opacity: 1;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

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

/* Modern Button */
.btn-primary {
    background: var(--gradient-primary);
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: 99px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(0, 210, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 25px rgba(153, 51, 255, 0.4);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--tx-primary);
    border: 1px solid var(--glass-border);
    padding: 12px 28px;
    border-radius: 99px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--tx-secondary);
    transform: translateY(-2px);
}

/* Glowing Input */
.form-input {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--tx-primary);
    padding: 14px;
    border-radius: var(--radius-sm);
    width: 100%;
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Badges & Tags */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-accent {
    background: var(--accent-glow);
    color: var(--tx-primary);
    border: 1px solid var(--accent);
}

/* Avatars */
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    transition: var(--transition);
}

.avatar:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #121212 25%, #1a1a1a 50%, #121212 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 12px;
    margin-bottom: 10px;
    width: 100%;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50% !important;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 10px;
}

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

/* Alerts */
.alert {
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border-left: 4px solid transparent;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border-left-color: #22c55e;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-left-color: #ef4444;
}

/* Post Card Component & Legacy Post Alias */
.post,
.post-card {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.post:hover,
.post-card:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px);
}

.post-header {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.post-user-pic,
.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border);
    object-fit: cover;
    transition: var(--transition);
}

.post:hover .post-user-pic,
.post-card:hover .post-avatar {
    border-color: var(--accent);
}

.post-user-info,
.post-meta {
    flex: 1;
}

.post-user-name,
.post-author {
    font-weight: 700;
    color: var(--tx-primary);
    margin: 0;
    font-size: 1.1rem;
}

.post-date,
.post-time {
    font-size: 0.85rem;
    color: var(--tx-muted);
}

.post-content {
    padding: 0 16px 16px;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--tx-primary);
}

.post-actions {
    display: flex;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    gap: 16px;
    justify-content: space-around;
}

.post-action-btn {
    background: none;
    border: none;
    color: var(--tx-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
}

.post-action-btn:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
}

.post-action-btn.active,
.post-action-btn.liked {
    color: #ff3366;
}

/* Premium Logo */
.logo-premium {
    max-width: 150px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 20px var(--accent-glow));
    animation: float 3s ease-in-out infinite;
    will-change: transform;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .glass-card, .post-card {
        padding: 16px;
        border-radius: var(--radius-sm);
    }
    
    .btn-primary {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .avatar, .post-avatar, .post-user-pic {
        width: 40px;
        height: 40px;
    }
}

/* Visibility Helpers */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
}

.show-mobile { display: none !important; }
@media (max-width: 768px) {
    .show-mobile { display: block !important; }
}

/* Fluid Typography */
.text-hero {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    line-height: 1.1;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.text-title {
    font-size: clamp(1.25rem, 5vw, 2rem);
    line-height: 1.3;
    font-weight: 700;
}

.text-body {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    line-height: 1.6;
}

/* Responsive Grid */
.auto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 24px;
}

@media (max-width: 480px) {
    .auto-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Micro-animations */
@keyframes reveal {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.reveal {
    animation: reveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: opacity, transform;
}

/* Subtle Hover Glow for Links */
.glow-link {
    position: relative;
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

.glow-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gradient-primary);
    transition: var(--transition);
}

.glow-link:hover::after {
    width: 100%;
}

/* Premium Mini Audio Player (Community Posts) */
.post-audio-player {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: 99px;
    margin-top: 16px;
    backdrop-filter: blur(10px);
}

.post-audio-player .play-pause-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition);
    flex-shrink: 0;
}

.post-audio-player .play-pause-btn:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.audio-progress-container {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.audio-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
}

.post-audio-player .time-display {
    font-size: 12px;
    font-family: monospace;
    color: var(--tx-secondary);
    min-width: 45px;
    text-align: center;
}

/* --- Standardized Premium Modals --- */
/* Modal System */
.waeyuk-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(0px);
}

.waeyuk-modal.open {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(15px);
}

.waeyuk-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

.waeyuk-modal-content {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    width: 100%;
    max-width: 500px;
    padding: 40px;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
}

.waeyuk-modal.open .waeyuk-modal-content {
    transform: scale(1) translateY(0);
}

.waeyuk-modal-close {
    position: absolute;
    top: 24px;
    left: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--tx-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.waeyuk-modal-close:hover {
    background: rgba(255, 0, 0, 0.2);
    color: #ff4d4d;
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .waeyuk-modal-content {
        padding: 20px;
        border-radius: 24px;
        width: 95%;
    }
}

/* Premium Auth Toggle with Sliding Animation */
.auth-toggle {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    padding: 6px;
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    height: 52px;
}

.auth-slider {
    position: absolute;
    width: calc(50% - 6px);
    height: calc(100% - 12px);
    background: var(--gradient-primary);
    border-radius: 99px;
    top: 6px;
    right: 6px; /* Starts on Login (Right side in RTL) */
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1;
    box-shadow: 0 8px 25px rgba(0, 210, 255, 0.3);
}

/* Move slider to Register (Left side) */
.auth-toggle:not(.login-mode) .auth-slider {
    transform: translateX(calc(-100% - 0px)); /* Moves left in RTL */
}

.toggle-btn {
    flex: 1;
    padding: 0;
    border-radius: 99px;
    border: none;
    background: transparent !important;
    color: var(--tx-secondary);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.3s ease;
    font-size: 0.95rem;
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn.active {
    color: #fff;
}

.toggle-btn:not(.active):hover {
    color: var(--tx-primary);
}

/* Premium Buttons & Dividers */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #fff;
    color: #1f1f1f;
    border: none;
    border-radius: 16px;
    padding: 14px 24px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 15px;
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.05);
}

.btn-google:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.1);
}

.btn-google img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.divider {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--tx-muted);
    font-size: 0.85rem;
    margin: 25px 0;
}

/* Modern Toggle Switch Style (from Sawtak) */
.modern-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.modern-toggle .hidden {
    display: none;
}

.toggle-track {
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right: 3px; /* Default for RTL */
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.modern-toggle input:checked + .toggle-track {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.modern-toggle input:checked + .toggle-track .toggle-thumb {
    right: calc(100% - 17px);
    background: #fff;
}

.modern-toggle span {
    font-size: 0.85rem;
    color: var(--tx-secondary);
    font-weight: 500;
}

.glow-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.glow-link:hover {
    color: var(--success);
    text-shadow: 0 0 8px var(--accent-glow);
}

/* Password Mirror & Fancy Inputs */
.password-container {
    position: relative;
    margin-bottom: 20px;
}

.password-input-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    height: 58px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.password-input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 210, 255, 0.15);
}

.form-input-password {
    position: absolute;
    inset: 0;
    background: transparent !important;
    border: none !important;
    padding: 0 50px 0 18px !important; /* Start from left (18px), room for icon on right (50px) */
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    caret-color: #fff !important;
    z-index: 2;
    font-size: 16px !important;
    font-family: monospace !important;
    letter-spacing: calc(14px - 1ch) !important; /* Each character exactly 14px wide */
    line-height: 58px !important; /* Vertical center in wrapper */
    outline: none;
    direction: ltr !important;
    text-align: left !important;
    box-sizing: border-box;
}

/* Fix for browser autofill white background and visible text */
.form-input-password:-webkit-autofill,
.form-input-password:-webkit-autofill:hover, 
.form-input-password:-webkit-autofill:focus, 
.form-input-password:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 100px #0a0a0a inset !important;
    -webkit-text-fill-color: transparent !important;
    caret-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* For autofill detection in JS */
@keyframes onAutoFillStart { from {} to {} }
.form-input-password:-webkit-autofill {
    animation-name: onAutoFillStart;
}

/* Hide default password dots specifically for all browsers */
.form-input-password::-webkit-text-security-disc {
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
}

/* For Firefox/Standard */
.form-input-password {
    text-shadow: 0 0 0 transparent !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.password-input-wrapper.is-revealed .form-input-password {
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
}

.password-mirror {
    position: absolute;
    inset: 0;
    padding: 0 50px 0 18px; /* Adjusted to match input padding (right 50, left 18) */
    display: flex;
    align-items: center;
    gap: 0px;
    pointer-events: none;
    z-index: 3;
    height: 100%;
    overflow: visible;
    direction: ltr !important; /* Force LTR even in RTL pages */
    text-align: left !important;
}

.char-box {
    width: 14px;
    height: 24px;
    perspective: 1000px;
}

.char-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}

.password-input-wrapper.is-revealed .char-inner {
    transform: rotateX(180deg);
}

.char-front, .char-back {
    position: absolute;
    inset: 0;
    display: flex;
    transition: opacity 0.3s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', monospace !important;
    font-size: 1.1rem;
    letter-spacing: 0; /* Gap handles spacing */
    direction: ltr !important;
}

.char-front {
    opacity: 1;
    z-index: 2;
    visibility: visible;
    transition: opacity 0.3s, visibility 0.3s;
}

.password-input-wrapper.is-revealed .char-front {
    opacity: 0;
    visibility: hidden;
}

.char-front::before {
    content: "•";
    color: #ffffff !important;
    font-size: 2.2rem;
    line-height: 1;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.char-back {
    transform: rotateX(180deg);
    color: #fff;
    opacity: 0;
    z-index: 1;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.password-input-wrapper.is-revealed .char-back {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.password-toggle-premium {
    position: absolute;
    right: 18px; /* Moved to right to match LTR text start on left */
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 4;
    color: var(--tx-muted);
    transition: all 0.3s ease;
}

/* RTL Date Input fix */
input[type="date"].form-input-premium {
    text-align: right;
    direction: rtl;
}

.password-toggle-premium:hover {
    color: #fff;
}

.eye-svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.pupil-group {
    transition: transform 0.15s ease-out;
}

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

.pupil-group {
    transition: all 0.3s ease;
    opacity: 0; /* Hidden by default when masked */
    transform: scale(0.5);
}

.password-input-wrapper.is-revealed .pupil-group {
    opacity: 1;
    transform: scale(1);
}

/* Eye Open (Revealed) */
.password-input-wrapper.is-revealed .lid-top {
    d: path("M2 12s4-8 10-8 10 8 10 8") !important;
}

.password-input-wrapper.is-revealed .lid-bottom {
    d: path("M2 12s4 8 10 8 10-8 10-8") !important;
}

/* Eye Closed (Masked) - Perfect match with bottom curve */
.lid-top {
    d: path("M2 12s4 8 10 8 10-8 10-8") !important;
}

.lid-bottom {
    d: path("M2 12s4 8 10 8 10-8 10-8") !important;
}

/* Premium Bottom Navigation styles are now moved to navbar.php for consistency */

/* Share Buttons & Article Footer */
.article-footer-premium {
    margin-top: 80px;
    padding: 40px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.article-footer-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 0 0 10px 10px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.share-btn {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    text-decoration: none;
    font-size: 1.4rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    cursor: pointer;
    z-index: 5;
}

.share-btn:hover {
    transform: translateY(-8px) scale(1.1);
    color: #fff !important;
    background: var(--accent) !important;
    border-color: #fff !important;
    box-shadow: 0 15px 30px rgba(0, 210, 255, 0.4);
}

/* Platform specific colors */
.share-btn.fb:hover { background: #1877f2; border-color: #1877f2; box-shadow: 0 10px 20px rgba(24, 119, 242, 0.3); }
.share-btn.x:hover { background: #000; border-color: #fff; box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1); }
.share-btn.wa:hover { background: #25d366; border-color: #25d366; box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3); }
.share-btn.copy:hover { background: var(--accent); border-color: var(--accent); box-shadow: 0 10px 20px rgba(0, 210, 255, 0.3); }
.share-btn.mail:hover { background: #ea4335; border-color: #ea4335; box-shadow: 0 10px 20px rgba(234, 67, 53, 0.3); }

/* Tooltip style feedback */
.share-btn::after {
    content: attr(data-label);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    opacity: 0;
    transition: 0.3s;
    white-space: nowrap;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
}

.share-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .share-buttons { gap: 15px; }
    .share-btn { width: 48px; height: 48px; border-radius: 14px; font-size: 1.1rem; }
}

@media (max-width: 768px) {
    .navbar {
        bottom: 10px;
        width: calc(100% - 20px);
        padding: 8px 15px;
    }
    .navbar a {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}
