:root {
    --primary-color: #fd6120;
    --primary-dark: #cc4d0d;
    --accent-color: #fbbf24;
    --accent-hover: #f59e0b;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-light: #f8fafc;
    --text-dim: #94a3b8;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-light);
    direction: rtl;
    overflow-x: hidden;
    position: relative;
    padding: 1rem;
}

body::before,
body::after {
    display: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

/* Typography */
h1, h2, h3 {
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 {
    font-size: 3rem;
    background: linear-gradient(to right, #fff, #fbbf24);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.2;
}

p {
    line-height: 1.6;
    color: var(--text-dim);
}

/* Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15);
}

/* Input Grid */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Input Cards */
.input-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 16px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.input-card:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.1);
}

.icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-left: auto;
    margin-right: auto;
}

.icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    width: 100%;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(253, 97, 32, 0.4);
    min-height: 55px;
    touch-action: manipulation;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(253, 97, 32, 0.6);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

/* Result Box */
.result-box {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(253, 97, 32, 0.1);
    border: 1px solid rgba(253, 97, 32, 0.3);
    border-radius: 20px;
    text-align: center;
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.result-box.show {
    display: block;
}

.result-amount {
    font-size: 2.5rem;
    color: var(--accent-color);
    font-weight: 800;
    margin: 1rem 0;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
    word-wrap: break-word;
}

/* Live Badge */
.live-badge {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #f87171;
    border-radius: 50px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #f87171;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Instructions Link */
.instructions-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    text-decoration: none;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    font-weight: 500;
}

.instructions-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(248, 113, 113, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Admin Grid */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(255,255,255,0.1);
    border-radius: 50px;
    transition: 0.3s;
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.toggle-handle {
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

/* Section Title */
.section-title {
    color: var(--accent-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

/* Icon Preview */
.icon-preview {
    width: 50px;
    height: 50px;
    margin-top: 5px;
    object-fit: contain;
    background: rgba(255,255,255,0.05);
    padding: 5px;
    border-radius: 8px;
    display: none;
}

/* Site Logo */
.site-logo-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 40;
    max-width: 100px;
    max-height: 100px;
    pointer-events: none;
    animation: fadeIn 1s ease-out;
}

.site-logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

/* Site Footer */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-dim);
    font-size: 0.9rem;
    z-index: 50;
    border-top: 1px solid var(--glass-border);
}

.site-footer a {
    color: var(--text-dim);
    transition: color 0.3s;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--accent-color);
}

/* Admin Nav */
.admin-menu {
    position: sticky;
    top: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    padding: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: var(--glass-bg);
}

.admin-menu a {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    transition: 0.3s;
    white-space: nowrap;
    font-size: 0.9rem;
}

.admin-menu a:hover,
.admin-menu a.active {
    background: var(--accent-color);
    color: #0f172a;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 1rem 2rem;
    border-radius: 12px;
    color: #fff;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: rgba(34, 197, 94, 0.9);
    border: 1px solid rgba(34, 197, 94, 0.5);
}

.toast.error {
    background: rgba(239, 68, 68, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

/* Responsive - Tablets */
@media (max-width: 1024px) {
    body {
        align-items: flex-start;
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    .container {
        width: 90%;
        padding: 0;
    }

    .glass-card {
        padding: 2rem;
        margin-top: 2rem;
    }

    h1 {
        font-size: 2.2rem;
    }

    .input-grid {
        gap: 1.5rem;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .site-logo-container {
        position: relative;
        bottom: auto;
        left: auto;
        text-align: center;
        margin: 0 auto 1.5rem auto;
        max-width: 100px;
        max-height: 100px;
        display: block;
        width: 100%;
    }

    body {
        flex-direction: column;
        justify-content: flex-start;
    }

    .site-footer {
        padding-bottom: 3rem;
        position: relative;
        background: transparent;
        border: none;
        margin-top: 2rem;
    }
}

/* Responsive - Mobile */
@media (max-width: 650px) {
    body {
        align-items: flex-start;
        padding-top: 5rem;
        padding-bottom: 2rem;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .glass-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .input-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .input-card {
        display: grid;
        grid-template-columns: 44px 1fr;
        align-items: center;
        text-align: right;
        padding: 0.8rem;
        gap: 0 8px;
    }

    .input-card label {
        display: block;
        grid-column: 2;
        margin-bottom: 0;
        font-size: 0.75rem;
        color: var(--text-dim);
        transform: translateY(4px);
    }

    .input-card input {
        grid-column: 2;
        font-size: 1.1rem;
        padding: 0.5rem 0;
        background: transparent;
        border: none;
        border-bottom: 1px solid var(--glass-border);
        border-radius: 0;
        min-width: 0;
    }

    .input-card input:focus {
        box-shadow: none;
        border-color: var(--accent-color);
    }

    .icon {
        grid-row: 1 / 3;
        font-size: 1.3rem;
        width: 40px;
        height: 40px;
        overflow: hidden;
    }

    .icon img {
        width: 32px;
        height: 32px;
    }

    .result-amount {
        font-size: 2rem;
    }

    .btn {
        padding: 1rem;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }
}

/* Very Small Screens */
@media (max-width: 380px) {
    h1 {
        font-size: 1.8rem;
    }

    .live-badge {
        top: 0.5rem;
        left: 50%;
        transform: translateX(-50%);
        width: auto;
    }

    body {
        padding-top: 4rem;
    }
}
