/**
 * Royal Dream Events Admin - Styles
 */

/* General Styles */
.admin-body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Login Styles */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: #333;
    margin-bottom: 0.5rem;
}

/* Sidebar */
.sidebar {
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .sidebar {
        position: fixed;
        top: 56px;
        bottom: 0;
        left: 0;
        z-index: 100;
    }
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 56px);
    padding-top: 0.5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    color: #333;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.sidebar .nav-link:hover {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.sidebar .nav-link.active {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
}

/* Main Content */
main {
    margin-top: 56px;
}

.admin-section {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
}

/* Image Grid */
.image-card {
    position: relative;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease-in-out;
}

.image-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.image-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.image-info {
    padding: 1rem;
}

.image-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.image-meta {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.image-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.image-actions .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

.upload-area.dragover {
    border-color: #0056b3;
    background-color: rgba(0, 123, 255, 0.1);
}

/* Selected Files */
.selected-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

.selected-file img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 0.5rem;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #333;
}

.file-size {
    font-size: 0.8rem;
    color: #666;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Masthead Management */
.masthead-item {
    position: relative;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.masthead-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    position: relative;
}

.masthead-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.masthead-controls {
    padding: 1rem;
}

.rotation-order {
    display: inline-block;
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    text-align: center;
    line-height: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    position: absolute;
    top: 10px;
    left: 10px;
}

/* Theme Management */
.theme-pair {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.theme-image {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.theme-image img {
    width: 100%;
    max-width: 180px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #eee;
}

.theme-image-label {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.theme-actions {
    flex: 0 0 140px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

.theme-actions .theme-name {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.theme-actions .theme-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Clickable thumbnail hover effect */
.clickable-thumb {
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.clickable-thumb:hover {
    opacity: 0.8;
    transform: scale(1.03);
}

/* Responsive */
@media (max-width: 768px) {
    main {
        margin-left: 0 !important;
        margin-top: 0;
    }

    .theme-pair {
        flex-direction: column;
    }

    .theme-actions {
        flex: unset;
        flex-direction: row;
        width: 100%;
    }

    .theme-actions .theme-buttons {
        flex-direction: row;
    }

    .image-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* Status Badges */
.status-active {
    background-color: #28a745;
}

.status-inactive {
    background-color: #dc3545;
}

.status-draft {
    background-color: #ffc107;
    color: #212529;
}

/* Drag and Drop */
.sortable-ghost {
    opacity: 0.4;
}

.sortable-chosen {
    transform: scale(1.02);
}

/* Alert Messages */
.alert-dismissible {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Button Styles */
.btn-custom {
    border-radius: 20px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Image Category Badges */
.category-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    background-color: #6c757d;
    color: #fff;
}

.category-masthead { background-color: #1565c0; color: #fff; }
.category-princess-parties { background-color: #ad1457; color: #fff; }
.category-baby-showers { background-color: #6a1b9a; color: #fff; }
.category-corporate-events { background-color: #2e7d32; color: #fff; }
.category-portfolio-carousel,
.category-portfolio-grid { background-color: #e65100; color: #fff; }
.category-team { background-color: #00695c; color: #fff; }

/* ============================================================
   Dark / Light Theme
   Uses Bootstrap 5.3 data-bs-theme="dark" for components;
   the block below handles our custom classes only.
   ============================================================ */
[data-bs-theme="dark"] .admin-body {
    background-color: #1a1d23;
}

[data-bs-theme="dark"] .sidebar {
    background-color: #1e2128 !important;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.07);
}

[data-bs-theme="dark"] .sidebar .nav-link {
    color: #adb5bd;
}

[data-bs-theme="dark"] .sidebar .nav-link:hover,
[data-bs-theme="dark"] .sidebar .nav-link.active {
    color: #6ea8fe;
    background-color: rgba(110, 168, 254, 0.12);
}

[data-bs-theme="dark"] .image-card {
    background: #252830;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .image-thumbnail {
    border-bottom-color: #373b44;
}

[data-bs-theme="dark"] .image-title {
    color: #e9ecef;
}

[data-bs-theme="dark"] .image-meta {
    color: #adb5bd;
}

[data-bs-theme="dark"] .upload-area {
    border-color: #495057;
    color: #adb5bd;
}

[data-bs-theme="dark"] .upload-area:hover,
[data-bs-theme="dark"] .upload-area.dragover {
    border-color: #6ea8fe;
    background-color: rgba(110, 168, 254, 0.08);
}

[data-bs-theme="dark"] .selected-file {
    background-color: #2c3038;
}

[data-bs-theme="dark"] .file-name {
    color: #e9ecef;
}

[data-bs-theme="dark"] .file-size {
    color: #adb5bd;
}

[data-bs-theme="dark"] .theme-pair {
    background: #252830;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .theme-image-label {
    color: #8b929a;
}

[data-bs-theme="dark"] .theme-image img {
    border-color: #495057;
}

[data-bs-theme="dark"] .login-card {
    background: #252830;
}

[data-bs-theme="dark"] .login-header h2 {
    color: #e9ecef;
}

[data-bs-theme="dark"] .masthead-item {
    background: #252830;
}

[data-bs-theme="dark"] .loading-overlay {
    background-color: rgba(26, 29, 35, 0.85);
}

/* Theme toggle button */
#themeToggle {
    transition: transform 0.2s ease;
}

#themeToggle:hover {
    transform: rotate(20deg);
}

/* Image Picker (theme edit modal) */
.image-picker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.image-picker-item {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.image-picker-item:hover {
    border-color: #6ea8fe;
    transform: scale(1.05);
}

.image-picker-item.selected {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.35);
}

.min-height-preview {
    min-height: 36px;
}

/* Utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.border-dashed {
    border-style: dashed !important;
}

/* Floating Feedback Button */
.btn-feedback-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1050;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-feedback-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}