/* style.css - النسخة الذهبية الكاملة (شاملة إصلاح المجلدات والموبايل) */

/* =========================================
   1. المتغيرات والأساسيات
   ========================================= */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg: #f3f4f6;
    --white: #ffffff;
    --text: #1f2937;
    --gray: #6b7280;
    --danger: #ef4444;
    --success: #10b981;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    direction: rtl;
    line-height: 1.5;
    padding-bottom: 120px;
    /* مسافة أمان في الأسفل */
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   2. شريط التنقل (Navbar)
   ========================================= */
.navbar {
    background: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 700;
    color: #111827;
}

.nav-btn {
    font-family: inherit;
    font-weight: bold;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-backup {
    background-color: #f59e0b;
}

.btn-backup:hover {
    background-color: #d97706;
    transform: translateY(-2px);
}

.btn-logout {
    background-color: #ef4444;
}

.btn-logout:hover {
    background-color: #dc2626;
}

.btn-play {
    background-color: #8b5cf6;
}

.btn-play:hover {
    background-color: #22c55e;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

@keyframes iconBlink {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.btn-play:hover i {
    animation: iconBlink 1s infinite;
}

/* =========================================
   3. الأزرار العامة والنماذج
   ========================================= */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #e5e7eb;
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-rename-all {
    background-color: #f59e0b;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 6px 15px;
    font-size: 0.95rem;
    cursor: pointer;
    margin-right: 15px;
    transition: 0.2s;
    font-family: inherit;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-rename-all:hover {
    background-color: #d97706;
    transform: translateY(-1px);
}

.edit-title-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.2rem;
    margin-right: 10px;
    transition: 0.2s;
}

.edit-title-btn:hover {
    color: var(--primary);
}

/* تنسيق الحقول الافتراضي */
input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* =========================================
   4. تنسيقات صفحة الألبومات (Home) - المستعادة
   ========================================= */

/* صندوق إضافة ألبوم (كبير وواضح) */
.add-album-box {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    border: 1px solid #e5e7eb;
}

/* تكبير حقل الإدخال */
.add-album-box input[type="text"] {
    font-size: 1.1rem;
    padding: 14px 20px;
    background-color: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.add-album-box input[type="text"]:focus {
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* زر الإنشاء */
.add-album-box .btn-primary {
    font-size: 1.1rem;
    padding: 14px 30px;
    border-radius: 8px;
}

/* شبكة الألبومات (تختلف عن الصور) */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* كارت الألبوم */
.album-card {
    background: var(--white);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s;
    border: 2px solid #e5e7eb;
    /* إطار رمادي افتراضي */
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    height: 100%;
    justify-content: center;
    cursor: pointer;
}

/* تأثير الهوفر الأخضر (المستعاد) */
.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.15);
    /* ظل أخضر */
    border-color: #10b981;
    /* إطار أخضر */
    background-color: #ecfdf5;
    /* خلفية خضراء فاتحة */
}

.album-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    transition: transform 0.3s;
}

.album-card:hover .album-icon {
    transform: scale(1.1);
}

/* أزرار التحكم الصغيرة في الألبوم (المستعادة) */
.album-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: 0.2s;
    z-index: 5;
}

.album-card:hover .album-controls {
    opacity: 1;
}

.mini-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d1d5db;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    font-size: 0.9rem;
    transition: 0.2s;
}

.mini-btn:hover {
    transform: scale(1.15);
    border-color: transparent;
    color: white;
}

/* ألوان الأزرار الصغيرة عند الهوفر */
.mini-btn.rename:hover {
    background-color: #f59e0b;
    /* برتقالي */
}

.mini-btn.move:hover {
    background-color: #3b82f6;
    /* أزرق */
}

.mini-btn.delete:hover {
    background-color: #ef4444;
    /* أحمر */
}

/* =========================================
   5. شبكة الصور (Gallery Grid)
   ========================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 25px;
    margin-bottom: 40px;
}

/* كارت الصورة */
.photo-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
    border: 3px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: relative;
    user-select: none;
}

.photo-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    z-index: 5;
    border-color: #d1d5db;
}

.photo-card.selected-card {
    border-color: var(--primary) !important;
    background-color: #e0e7ff;
    box-shadow: 0 0 0 2px var(--primary);
}

/* الصورة */
.img-wrapper {
    height: 200px;
    width: 100%;
    overflow: hidden;
    background: #f3f4f6;
    position: relative;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.photo-card:hover .img-wrapper img {
    transform: scale(1.1) rotate(1deg);
}

/* تفاصيل الصورة */
.photo-details {
    padding: 15px 10px;
    text-align: center;
    background-color: #f8fafc;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.photo-desc {
    background: #fff7e3;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 15px;
    margin: 0 auto 10px auto;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    border-radius: 2px;
    position: relative;
    transform: rotate(-1deg);
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-size {
    font-size: 0.75rem;
    color: #9ca3af;
    display: block;
}

/* =========================================
   6. أدوات الصورة (شريط الأزرار)
   ========================================= */
.photo-actions-bar {
    padding: 10px 5px;
    border-top: 1px dashed #eee;
    background: #fafafa;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background-color: #fff;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 1px;
}

.action-btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.action-btn.edit:hover {
    background-color: #dbeafe;
    color: #2563eb;
    border-color: #93c5fd;
    transform: translateY(-3px);
}

.action-btn.focus-btn:hover {
    background-color: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    transform: translateY(-3px) scale(1.1);
}

.action-btn.crop:hover {
    background-color: #ffedd5;
    color: #ea580c;
    border-color: #fdba74;
    transform: translateY(-3px) rotate(90deg);
}

.action-btn.rotate:hover {
    background-color: #fef9c3;
    color: #ca8a04;
    border-color: #fde047;
    transform: translateY(-3px) rotate(180deg);
}

.action-btn.mirror:hover {
    background-color: #ccfbf1;
    color: #0d9488;
    border-color: #5eead4;
    transform: translateY(-3px) scaleX(-1);
}

.action-btn.whatsapp:hover {
    background-color: #dcfce7;
    color: #16a34a;
    border-color: #86efac;
    transform: translateY(-3px);
}

/* زر العصا السحرية */
.magic-link-btn i {
    display: inline-block;
    transition: transform 0.2s;
}

.magic-link-btn:hover i.fa-wand-magic-sparkles {
    animation: wandWiggle 0.6s ease-in-out infinite;
}

.magic-link-btn:hover {
    background: #f3e8ff !important;
    color: #7c3aed !important;
    border-color: #d8b4fe !important;
}

/* زر البازل */
.puzzle-btn-link:hover i {
    animation: spinFast 0.6s linear infinite;
}

.puzzle-btn-link:hover {
    background: #d97706 !important;
    color: #fff !important;
    border-color: #b45309 !important;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
}

@keyframes spinFast {
    0% {
        transform: rotate(0deg) scale(1);
    }

    100% {
        transform: rotate(360deg) scale(1.3);
    }
}

@keyframes wandWiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-20deg);
    }

    75% {
        transform: rotate(20deg);
    }
}

/* =========================================
   7. التشيك بوكس والاختيار (DragSelect)
   ========================================= */
.checkbox-wrapper {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 20;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    padding: 2px;
    display: flex;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.photo-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
    transform: scale(1.3);
    margin: 0;
}

.ds-selector {
    background-color: rgba(79, 70, 229, 0.15);
    border: 2px dashed var(--primary);
    z-index: 9999;
    pointer-events: none;
}

/* =========================================
   8. الشريط العائم (Bulk Actions) - للموبايل
   ========================================= */
.bulk-bar {
    position: fixed;
    bottom: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 700px;
    z-index: 999;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bulk-bar.active {
    bottom: 30px;
}

.bulk-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.bulk-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.selected-count {
    font-weight: bold;
    color: var(--text);
    white-space: nowrap;
}

/* === موبايل === */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 15px;
    }

    .bulk-bar {
        width: 96% !important;
        left: 2% !important;
        transform: none !important;
        padding: 12px !important;
        border-radius: 16px !important;
        bottom: -300px !important;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(5px);
    }

    .bulk-bar.active {
        bottom: 10px !important;
    }

    .bulk-content {
        flex-direction: column;
        gap: 12px;
    }

    .custom-tree-select {
        width: 100% !important;
    }

    .select-box {
        padding: 12px;
    }

    .selected-count {
        width: 100%;
        text-align: center;
        margin-bottom: -5px;
        font-size: 0.9rem;
        color: #666;
    }

    .bulk-actions {
        display: flex;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }

    .bulk-actions button {
        flex: 1;
        padding: 12px 5px;
        font-size: 0.9rem;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 5px;
    }

    .bulk-bar .tree-content {
        bottom: 100% !important;
        margin-bottom: 5px;
        max-height: 250px;
    }

    .new-sub-album-form {
        flex-direction: column;
    }

    .container {
        padding: 0 10px;
    }
}

/* =========================================
   10. تقرير الحجم (Compression Report)
   ========================================= */
.size-badge {
    background: linear-gradient(135deg, #fee2e2 0%, #e0f2fe 100%);
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 4px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #334155;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: sans-serif;
    direction: ltr;
}

.size-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.magic-report-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    margin: 25px 0;
    align-items: center;
    direction: ltr !important;
}

.report-item {
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    border: 1px dashed #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.report-label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.report-value {
    display: block;
    font-weight: bold;
    color: #1e293b;
    font-size: 1.1rem;
}

.factor-badge {
    background: linear-gradient(135deg, #4f46e5, #8b5cf6);
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    display: inline-block;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    margin-top: 15px;
    direction: ltr;
    font-family: sans-serif;
}

/* المودال السحري للأيقونة */
.magic-icon-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
}

.magic-icon {
    font-size: 35px;
    color: white;
    animation: shakeIcon 2s infinite ease-in-out;
}

@keyframes shakeIcon {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

/* =========================================
   9. GLightbox + Slideshow
   ========================================= */
.gslide-image img,
#slideshow-img.visible {
    padding: 12px !important;
    background: linear-gradient(45deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c) !important;
    box-shadow: 0 0 0 2px #5a400a inset, 0 0 30px rgba(255, 215, 0, 0.5), 0 20px 50px rgba(0, 0, 0, 0.9) !important;
    border-radius: 8px !important;
    max-height: 85vh !important;
    border: none !important;
}

#slideshow-img {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 1.5s, transform 1.5s;
    max-width: 90% !important;
}

#slideshow-img.visible {
    opacity: 1 !important;
    transform: scale(1) !important;
}

.glightbox-container .goverlay,
#slideshow-overlay {
    background: #000000 !important;
    opacity: 0.96 !important;
}

.gbtn,
.slideshow-btn {
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 50%;
    margin: 15px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 215, 0, 0.3) !important;
    transition: all 0.3s ease !important;
}

.gbtn:hover,
.slideshow-btn:hover {
    background: linear-gradient(45deg, #bf953f, #fcf6ba) !important;
    border-color: #fff !important;
    color: #2c1e05 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6) !important;
    transform: scale(1.1);
}

.glightbox-container .gslide-title {
    display: none !important;
}

.glightbox-container .gslide-description {
    background: transparent !important;
    bottom: 35px;
    z-index: 9999;
}

/* إصلاح حاوية السلايد شو */
#slideshow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background-color: #000000 !important;
}

#visualizer-canvas {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.8;
}

/* =========================================
   10. Modals & Tree View & Others
   ========================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    text-align: center;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: black;
    text-decoration: none;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Tree View */
.custom-tree-select {
    position: relative;
    width: 100%;
    font-family: inherit;
}

.select-box {
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
}

.select-box:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tree-content {
    display: none;
    position: absolute;
    width: 100%;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 2000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-top: 5px;
}

.tree-content input[type="text"] {
    width: 90%;
    margin: 10px 5%;
    padding: 8px;
    border: 1px solid #eee;
    border-radius: 4px;
    box-sizing: border-box;
}

ul.folder-tree,
ul.folder-tree ul {
    list-style: none;
    padding: 0;
    margin: 0;
    direction: rtl;
}

ul.folder-tree li {
    padding: 0;
    cursor: pointer;
    position: relative;
}

.folder-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 4px;
    transition: 0.2s;
    border-bottom: 1px solid #f9f9f9;
}

.folder-item:hover {
    background-color: #eff6ff;
    color: var(--primary);
}

.has-children-icon {
    color: #f59e0b;
    margin-left: 8px;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.empty-folder-icon {
    color: #60a5fa;
    margin-left: 8px;
    font-size: 1.2rem;
}

.toggle-icon {
    width: 24px;
    text-align: center;
    transition: transform 0.2s;
    color: #9ca3af;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

ul.folder-tree ul {
    margin-right: 22px;
    display: none;
    border-right: 2px solid #f0f0f0;
}

ul.folder-tree li.expanded>ul {
    display: block !important;
}

.expanded>.folder-item .toggle-icon i {
    transform: rotate(-90deg);
    color: var(--primary);
}

.bulk-bar .tree-content {
    top: auto !important;
    bottom: 110% !important;
    margin-bottom: 10px;
    margin-top: 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
}

/* Magic Modal */
.magic-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeInOverlay 0.3s ease;
}

.magic-modal-card {
    background: white;
    padding: 40px 30px 30px;
    border-radius: 24px;
    text-align: center;
    width: 320px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    border: 2px solid #e9d5ff;
    transform: scale(0.8);
    opacity: 0;
    animation: popInCard 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.magic-glow-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(168, 85, 247, 0.1), transparent);
    animation: spinGlow 4s linear infinite;
    z-index: -1;
}

.magic-icon-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
}

.magic-icon {
    font-size: 35px;
    color: white;
    animation: shakeIcon 2s infinite ease-in-out;
}

.magic-modal-btn {
    background: linear-gradient(90deg, #9333ea, #7c3aed);
    color: white;
    border: none;
    padding: 12px 35px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
    z-index: 1;
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.3);
    font-family: inherit;
}

.magic-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.5);
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes popInCard {
    from {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes spinGlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes shakeIcon {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(-10deg) scale(1.1);
    }
}

/* Floating Controls */
#floating-controls {
    position: fixed;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2147483647 !important;
    width: auto;
}

#fc-name-input {
    background: linear-gradient(to bottom, #d4af37, #fcf6ba, #b38728);
    color: #3e2b06;
    padding: 10px 35px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    font-weight: bold;
    font-family: inherit;
    font-size: 1.1rem;
    text-align: center;
    border: none;
    border-top: 1px solid #fffadd;
    border-bottom: 2px solid #8c6611;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
    outline: none;
    width: auto;
    min-width: 300px;
    transition: all 0.3s ease;
}

#fc-name-input:focus {
    background: linear-gradient(to bottom, #eac54e, #fffbd0, #c9982d);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.fc-btn {
    display: none !important;
}

#uModalIcon {
    font-size: 4rem;
    margin-bottom: 15px;
    display: block;
}

.u-icon-warning {
    color: #f59e0b;
}

.u-icon-danger {
    color: #ef4444;
}

.u-icon-success {
    color: #22c55e;
}

.u-icon-info {
    color: #3b82f6;
}

/* =========================================
   11. تحسينات الموبايل (Responsive & Moved Styles)
   ========================================= */

/* استعادة تنسيق قسم الرفع (Desktop) */
.upload-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    align-items: flex-start;
}

.upload-area-wrapper {
    flex: 2;
}

/* تنسيقات الناف بار (Moved from view_album.php) */
.nav-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* ألوان الأزرار */
.btn-memories {
    background-color: #8b5cf6;
}

.btn-music {
    background-color: #4f46e5;
}

.btn-visitors {
    background-color: #10b981;
}

.btn-profile {
    background-color: #f97316;
}

.btn-logout {
    background-color: #ef4444;
}

/* أنيميشن الأيقونات */
@keyframes jumpRotate {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    40% {
        transform: translateY(-6px) rotate(180deg);
    }

    80% {
        transform: translateY(0) rotate(360deg);
    }

    100% {
        transform: translateY(0) rotate(360deg);
    }
}

.nav-btn:hover i {
    animation: jumpRotate 0.6s ease-in-out;
}

/* === ميديا كويري للموبايل === */
@media (max-width: 768px) {

    /* 1. إخفاء نصوص الأزرار والاكتفاء بالأيقونة */
    .nav-btn span {
        display: none;
    }

    /* 2. تحسين تباعد الأزرار */
    .nav-actions {
        justify-content: center;
        gap: 8px;
        width: 100%;
    }

    /* 3. زر أكبر قليلاً للمس */
    .nav-btn {
        padding: 12px;
        margin: 2px;
        border-radius: 8px;
    }

    /* 4. ترتيب قسم الرفع عمودياً */
    .upload-section {
        flex-direction: column !important;
        gap: 15px !important;
    }

    .upload-area-wrapper,
    .new-sub-album-form {
        width: 100% !important;
        flex: none !important;
        min-width: 100% !important;
    }
}