/* ===== CSS Variables ===== */
:root {
    --bg-primary: linear-gradient(135deg, #1e3a4c 0%, #2d4a5e 50%, #3d5a6e 100%);
    --bg-secondary: rgba(255, 255, 255, 0.05);
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-card-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.5);
    --accent: #c9a962;
    --accent-light: #d4b872;
    --border: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.2);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* ===== Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #1e3a4c 0%, #2d4a5e 50%, #3d5a6e 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.8;
    font-feature-settings: "tnum";
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

::-webkit-scrollbar-corner {
    background: rgba(255, 255, 255, 0.05);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

/* ===== Container ===== */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bg-pattern::before,
.bg-pattern::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: linear-gradient(45deg,
            transparent 40%,
            rgba(255, 255, 255, 0.03) 45%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(255, 255, 255, 0.03) 55%,
            transparent 60%);
    background-size: 100% 100%;
    animation: rays 15s linear infinite;
}

.bg-pattern::after {
    background: linear-gradient(-45deg,
            transparent 40%,
            rgba(255, 255, 255, 0.02) 45%,
            rgba(255, 255, 255, 0.04) 50%,
            rgba(255, 255, 255, 0.02) 55%,
            transparent 60%);
    animation: rays 20s linear infinite reverse;
}

@keyframes rays {
    0% {
        transform: translateX(-25%) translateY(-25%) rotate(0deg);
    }

    100% {
        transform: translateX(25%) translateY(25%) rotate(360deg);
    }
}

.container {
    position: relative;
    z-index: 1;
}

/* ===== Header ===== */
.header {
    text-align: center;
    margin-bottom: 50px;
}

.logo-container {
    margin-bottom: 28px;
    display: inline-block;
}

.logo {
    width: 120px;
    height: 120px;
    min-width: 120px;
    min-height: 120px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 3px solid var(--accent);
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    object-fit: cover;
}

.title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
    letter-spacing: 0;
}

.divider {
    width: 50px;
    height: 2px;
    background: var(--accent);
    margin: 20px auto 0;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ===== Description Card ===== */
.description-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 32px;
    text-align: center;
}

.description-card::before {
    display: none;
}

.icon-container {
    width: 50px;
    height: 50px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.icon {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 2;
    margin-bottom: 24px;
}

.email-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    padding: 12px 24px;
    border: 1px solid var(--border);
    border-radius: 30px;
}

.email-inline svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.email-inline a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    direction: ltr;
    transition: color 0.2s;
}

.email-inline a:hover {
    color: var(--accent);
}

/* ===== Upload Button ===== */
.upload-btn {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.btn-icon {
    width: 32px;
    height: 32px;
    color: var(--accent);
}

.upload-btn span {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.btn-highlight {
    color: var(--text-primary) !important;
    font-size: 1.1rem !important;
    font-weight: 600;
}

/* ===== Counter Section ===== */
.counter-section {
    margin-top: auto;
    padding-top: 20px;
}

.counter-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.counter-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.counter-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.counter-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.counter-value {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding-top: 32px;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.admin-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-link svg {
    width: 14px;
    height: 14px;
}

.admin-link:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: linear-gradient(135deg, #1e3a4c 0%, #2d4a5e 100%);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: all 0.3s;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.modal-close svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.modal-close:hover {
    opacity: 0.6;
}

.modal-body {
    padding: 24px;
}

.upload-instructions {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 14px 18px;
    margin-bottom: 20px;
}

.upload-instructions p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ===== File Upload Area ===== */
.file-upload-area {
    border: 2px dashed var(--border);
    padding: 36px 20px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 16px;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--accent);
    background: var(--bg-secondary);
}

.upload-area-icon {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upload-text {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.file-input-label {
    display: inline-block;
    background: var(--accent);
    color: #1e3a4c;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
}

.file-input-label:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

.file-input {
    display: none;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 10px;
}

/* ===== Selected Files ===== */
.selected-files {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    padding: 10px 14px;
    font-size: 0.85rem;
}

.file-item-name {
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item-size {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: 10px;
}

.file-item-remove {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-item-remove:hover {
    color: #c0392b;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s;
    line-height: 1.7;
    background: var(--bg-card);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-textarea::placeholder {
    color: var(--text-muted);
}

/* ===== Progress Bar ===== */
.progress-container {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.progress-container.active {
    display: flex;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 40px;
}

/* ===== Modal Actions ===== */
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 12px 24px;
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #1e3a4c;
    font-weight: 600;
    border-radius: 8px;
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-icon-small {
    width: 16px;
    height: 16px;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--text-primary);
    color: white;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-hover);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    width: 20px;
    height: 20px;
    color: #27ae60;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .container {
        padding: 40px 16px;
    }

    .title {
        font-size: 1.5rem;
    }

    .logo {
        width: 80px;
    }

    .description-card {
        padding: 28px 20px;
    }

    .upload-btn {
        padding: 24px 20px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }
}