/**
 * Outfit Bikaam - Main Stylesheet
 * نظام الألوان: أزرق غامق + أحمر
 * التصميم: Glassmorphism
 */

/* ===== Variables ===== */
:root {
    /* Colors */
    --primary-blue: #1a237e;
    --primary-blue-light: #3949ab;
    --primary-blue-dark: #0d47a1;
    --primary-red: #c62828;
    --primary-red-light: #e53935;
    --primary-red-dark: #b71c1c;
    
    /* Gradients */
    --bg-gradient: linear-gradient(135deg, #1a237e 0%, #0d47a1 50%, #1565c0 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 10px;
    --radius-md: 15px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    
    /* Shadows */
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.2);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===== Glassmorphism Card ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ===== Header ===== */
.header {
    padding: var(--spacing-lg) 0;
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--text-primary), var(--primary-red-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ===== Upload Section ===== */
.upload-section h2,
.mode-section h2,
.results-section h2 {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.clothes-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.upload-box {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all 0.3s ease;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-box:hover {
    border-color: var(--primary-red-light);
    background: rgba(255, 255, 255, 0.08);
}

.upload-box.large {
    min-height: 350px;
}

.file-input {
    display: none;
}

.upload-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.upload-icon.large {
    font-size: 4rem;
}

.upload-label span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===== Buttons ===== */
.btn-upload {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    box-shadow: 0 4px 15px rgba(198, 40, 40, 0.3);
}

.btn-upload:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.4);
}

.btn-upload.secondary {
    background: var(--primary-blue-light);
    box-shadow: 0 4px 15px rgba(57, 73, 171, 0.3);
}

.btn-upload.secondary:hover {
    background: var(--primary-blue);
    box-shadow: 0 6px 20px rgba(57, 73, 171, 0.4);
}

/* ===== Preview ===== */
.preview-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.preview-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.btn-remove {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary-red);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-remove:hover {
    background: var(--primary-red-dark);
    transform: scale(1.1);
}

/* ===== Mode Selection ===== */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.mode-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-card:hover {
    border-color: var(--primary-red-light);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.mode-card.active {
    border-color: var(--primary-red);
    background: rgba(198, 40, 40, 0.2);
    box-shadow: 0 0 20px rgba(198, 40, 40, 0.3);
}

.mode-icon {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-sm);
}

.mode-card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.mode-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== Mannequin Selection ===== */
.mannequin-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.mannequin-type {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mannequin-type:hover {
    border-color: var(--primary-blue-light);
    background: rgba(255, 255, 255, 0.1);
}

.mannequin-type.active {
    border-color: var(--primary-red);
    background: rgba(198, 40, 40, 0.2);
}

.type-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xs);
}

.mannequin-type span {
    display: block;
    font-weight: 600;
}

/* ===== Smart Suggestion ===== */
.smart-suggestion {
    margin: var(--spacing-md) 0;
    animation: slideIn 0.5s ease;
}

.suggestion-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(57, 73, 171, 0.3);
    border-left: 4px solid var(--primary-blue-light);
}

.suggestion-icon {
    font-size: 1.5rem;
}

/* ===== Try Now Button ===== */
.action-section {
    text-align: center;
    margin: var(--spacing-xl) 0;
}

.btn-try-now {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-xl);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    box-shadow: 0 8px 30px rgba(198, 40, 40, 0.4);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn-try-now:hover:not(:disabled) {
    background: var(--primary-red-dark);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 40px rgba(198, 40, 40, 0.5);
}

.btn-try-now:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.8rem;
}

/* ===== Loading ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 35, 126, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    max-width: 400px;
    padding: var(--spacing-xl);
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-content h3 {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-sm);
}

.loading-content p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.loading-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-red), var(--primary-red-light));
    border-radius: 10px;
    width: 0%;
    animation: progress 3s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* ===== Results ===== */
.result-image-container {
    text-align: center;
    margin: var(--spacing-lg) 0;
}

.result-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* ===== Share Buttons ===== */
.share-actions {
    margin-top: var(--spacing-lg);
}

.share-actions h3 {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.btn-share {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--glass-border);
    color: white;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.btn-share:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.btn-share.facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
}

.btn-share.instagram:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    border-color: #e6683c;
}

.btn-share.whatsapp:hover {
    background: #25d366;
    border-color: #25d366;
}

.btn-share.download:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.share-icon {
    font-size: 1.3rem;
}

.share-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-try-again {
    width: 100%;
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    margin-top: var(--spacing-md);
}

.btn-try-again:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
}

/* ===== Tips ===== */
.tips-list {
    list-style: none;
    padding-right: var(--spacing-md);
}

.tips-list li {
    padding: var(--spacing-xs) 0;
    color: var(--text-secondary);
    position: relative;
    padding-right: var(--spacing-md);
}

.tips-list li::before {
    content: "✓";
    position: absolute;
    right: 0;
    color: var(--primary-red-light);
    font-weight: bold;
}

/* ===== Counter ===== */
.counter-section {
    text-align: center;
    padding: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.counter-section p {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-xl);
    border-top: 1px solid var(--glass-border);
}

.footer p {
    color: var(--text-secondary);
    margin: var(--spacing-xs) 0;
}

/* ===== Animations ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .clothes-upload-grid {
        grid-template-columns: 1fr;
    }
    
    .mode-grid {
        grid-template-columns: 1fr;
    }
    
    .mannequin-types {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .share-buttons {
        grid-template-columns: 1fr;
    }
    
    .btn-try-now {
        font-size: 1.2rem;
        padding: var(--spacing-md) var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .glass-card {
        padding: var(--spacing-md);
    }
    
    .upload-box {
        min-height: 200px;
    }
}
