/* Import Zain font */
@import url('https://fonts.googleapis.com/css2?family=Zain&display=swap');

:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --success-color: #4cc9f0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 10px;
    --box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    --font-family: 'Zain', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.text-gradient {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.upload-container {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover, .upload-area.dragover {
    background-color: rgba(67, 97, 238, 0.05);
}

.upload-icon {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 10px 25px;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
}

.upload-list {
    margin-top: 30px;
}

.upload-item {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.upload-item-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.file-icon {
    font-size: 24px;
    color: var(--primary-color);
    margin-left: 15px;
}

.file-info {
    flex-grow: 1;
}

.file-name {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.file-size {
    color: #6c757d;
    font-size: 14px;
}

.btn-cancel {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 18px;
}

.progress {
    height: 8px;
    margin-bottom: 10px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 4px;
    transition: width 0.2s ease;
}

.upload-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #6c757d;
}

/* تنسيقات لحالة الرفع */
.upload-status {
    font-size: 14px;
    color: #6c757d;
    margin-top: 5px;
    font-weight: 500;
}

/* تنسيق للملفات الكبيرة */
.large-file-indicator {
    background-color: rgba(255, 193, 7, 0.1);
    border-right: 3px solid #ffc107;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #856404;
    display: inline-block;
    margin-right: 10px;
}

/* تنسيق لمؤشر التقدم للملفات الكبيرة */
.large-file-progress .progress-bar {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
    transition: width 0.5s ease;
}

/* تنسيق لحالة الرفع المكتمل */
.upload-complete .upload-status {
    color: #28a745;
    font-weight: bold;
}

/* تنسيق لحالة الخطأ */
.upload-error .upload-status {
    color: #dc3545;
    font-weight: bold;
}

.completed-files {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
}

.completed-files h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--dark-color);
}

.table td {
    vertical-align: middle;
}

.copy-link {
    cursor: pointer;
    color: var(--primary-color);
}

.copy-link:hover {
    color: var(--secondary-color);
}

.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    min-width: 300px;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border-left: 4px solid #0f5132;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .upload-area {
        padding: 20px;
    }
    
    .container {
        padding: 10px;
        width: 100%;
        max-width: 100%;
    }
    
    .upload-container, .completed-files, .admin-panel, .card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    /* Improve button touch targets for mobile */
    .btn {
        padding: 10px 15px;
        margin: 5px;
        min-height: 44px; /* Apple's recommended minimum touch target size */
    }
    
    /* Adjust font sizes for mobile */
    body {
        font-size: 16px; /* Base font size for better readability on mobile */
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    /* Improve form elements for touch */
    input, select, textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 12px;
        margin-bottom: 10px;
    }
    
    /* Adjust table display for mobile */
    .table-responsive {
        border: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    /* Fix for iPhone notch and safe areas */
    .container {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    /* Better spacing for mobile */
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-header .d-flex {
        margin-top: 10px;
        width: 100%;
        justify-content: space-between;
    }
    
    /* Adjust admin actions for mobile */
    .admin-actions {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .admin-actions .btn {
        margin: 5px;
        flex: 1;
    }
    
    /* Fix input group for search */
    .input-group {
        width: 100%;
        max-width: 100% !important;
        margin-top: 10px;
    }
}

/* iPhone X and newer specific adjustments */
@media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3),
       only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2),
       only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3),
       only screen and (device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3),
       only screen and (device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) {
    
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .notification {
        top: calc(20px + env(safe-area-inset-top));
    }
}

/* Admin panel styles */
.admin-panel {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    margin-bottom: 30px;
}

/* Mobile-specific styles */
.mobile-checkbox {
    width: 40px;
}

.mobile-primary {
    min-width: 150px;
}

.mobile-size {
    width: 80px;
}

.mobile-actions {
    min-width: 120px;
}

.file-name-text {
    word-break: break-word;
    max-width: 200px;
    display: inline-block;
}

.action-buttons {
    justify-content: flex-start;
}

/* iPhone touch improvements */
.btn-sm {
    padding: 8px 12px;
    min-height: 38px;
}

@media (max-width: 576px) {
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 5px;
        border-radius: var(--border-radius) !important;
    }
    
    .action-buttons form {
        width: auto;
    }
    
    /* Fix for iPhone notch */
    .alert {
        margin-right: env(safe-area-inset-right);
    }
    
    /* Better spacing for buttons on small screens */
    .card-header .d-flex {
        flex-direction: column;
        align-items: stretch;
    }
    
    .card-header .d-flex button {
        margin-bottom: 10px;
    }
    
    /* Improve form inputs on iPhone */
    input[type="text"],
    input[type="password"] {
        -webkit-appearance: none;
        appearance: none;
        border-radius: var(--border-radius);
        padding: 10px 12px;
        font-size: 16px; /* Prevents iOS zoom */
    }
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
}

.login-form {
    max-width: 400px;
    margin: 100px auto;
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    border-radius: 5px;
    padding: 10px 15px;
    border: 1px solid #ced4da;
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-container input {
    margin-left: 10px;
}
