/* Custom styles for Image Processor App */

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

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes glowPulse {
    0%, 100% {
        border-color: #10b981;
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6), 0 0 40px rgba(16, 185, 129, 0.4);
    }
    50% {
        border-color: #059669;
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.8), 0 0 60px rgba(16, 185, 129, 0.6);
    }
}

/* Gradient Background */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    /* Safe area insets for notched devices */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Token Badge (Upper Right Corner) */
.token-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 24px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #4f46e5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    cursor: default;
    transition: all 0.3s ease;
}

.token-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.token-badge svg {
    color: #4f46e5;
}

.token-badge #tokenCount {
    min-width: 30px;
    text-align: center;
}

/* Glass morphism effect for cards */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hero Section */
.hero-tagline {
    color: rgba(255, 255, 255, 0.95);
}

.gradient-text {
    background: linear-gradient(90deg, #4c51bf 0%, #9333ea 50%, #4c51bf 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Tool Cards Grid */
.tool-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

@media (min-width: 768px) {
    .tool-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tool Card */
.tool-card {
    position: relative;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    padding: 32px;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.tool-card.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    border-color: rgba(102, 126, 234, 0.5);
}

.tool-card.active:hover {
    transform: translateY(-4px);
    border-color: rgba(102, 126, 234, 0.7);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.tool-card.active:hover::before {
    opacity: 1;
}

.tool-card.disabled {
    background: rgba(100, 100, 100, 0.1);
    border-color: rgba(150, 150, 150, 0.2);
    opacity: 0.5;
    cursor: not-allowed;
}

.tool-card.disabled:hover {
    transform: none;
}

.tool-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tool-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    margin-bottom: 20px;
    color: #667eea;
}

.tool-card.active .tool-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tool-card.disabled .tool-icon {
    background: rgba(150, 150, 150, 0.2);
    color: rgba(100, 100, 100, 0.5);
}

.tool-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
}

.tool-description {
    font-size: 1rem;
    color: #4a5568;
    margin-bottom: 24px;
}

.tool-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Coming Soon Badge */
.coming-soon-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(10px);
    color: #667eea;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    z-index: 10;
}

/* Progress Steps */
.step-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e5e7eb;
    z-index: -1;
}

.step-item.completed:not(:last-child)::after {
    background: #667eea;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #9ca3af;
    transition: all 0.3s ease;
    z-index: 1;
}

.step-item.active .step-circle {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: scale(1.1);
}

.step-item.completed .step-circle {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.step-label {
    margin-top: 8px;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.step-item.active .step-label {
    color: #667eea;
    font-weight: 600;
}

.step-item.completed .step-label {
    color: #10b981;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.upload-zone:hover {
    border-color: #667eea;
    background: #f1f5f9;
    transform: translateY(-2px);
}

.upload-zone.drag-over {
    border-color: #667eea;
    background: #eef2ff;
    border-style: solid;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
    /* Ensure minimum touch target size */
    min-height: 44px;
    min-width: 44px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: white;
    color: #667eea;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: 2px solid #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    /* Ensure minimum touch target size */
    min-height: 44px;
    min-width: 44px;
}

.btn-secondary:hover {
    background: #eef2ff;
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

/* Stage Container */
.stage-container {
    animation: fadeIn 0.5s ease;
}

/* Crop Container */
.crop-container {
    max-height: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar-fill {
    height: 12px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.4s ease;
    border-radius: 8px;
    position: relative;
}

.progress-percentage {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    text-align: center;
}

.progress-status-text {
    font-size: 0.95rem;
    color: #6b7280;
    text-align: center;
    margin-top: 0.75rem;
    min-height: 1.5rem;
}

/* Status Message */
.status-message {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    animation: fadeIn 0.3s ease;
}

.status-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.status-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

/* Library Help Text */
.library-help-text {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(168, 85, 247, 0.1);
    border-left: 3px solid rgba(168, 85, 247, 0.8);
    border-radius: 8px;
    margin-bottom: 20px;
    color: #6b21a8;
    font-size: 0.9rem;
    font-weight: 500;
}

.library-help-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.library-help-mobile {
    display: none;
}

@media (max-width: 768px) {
    .library-help-desktop {
        display: none;
    }

    .library-help-mobile {
        display: inline;
    }

    .library-help-text {
        font-size: 0.95rem;
        padding: 14px 18px;
    }
}

/* Parent Detail Help Banner */
.parent-help-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(168, 85, 247, 0.1);
    border-left: 3px solid rgba(168, 85, 247, 0.8);
    border-radius: 8px;
    margin-bottom: 20px;
    color: #6b21a8;
    font-size: 0.9rem;
    font-weight: 500;
}

.parent-help-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.parent-help-mobile {
    display: none;
}

@media (max-width: 768px) {
    .parent-help-desktop {
        display: none;
    }

    .parent-help-mobile {
        display: inline;
    }

    .parent-help-banner {
        font-size: 0.95rem;
        padding: 14px 18px;
    }
}

/* Library Grid - Thumbnails Grid */
.library-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .library-thumbnails-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* Parent Thumbnail */
.parent-thumbnail {
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.parent-thumbnail:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 32px rgba(168, 85, 247, 0.25);
    border: 2px solid rgba(168, 85, 247, 0.5);
}

.parent-thumbnail-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    background-size: cover;
    background-position: center top;
    transition: transform 0.3s ease;
}

.parent-thumbnail:hover .parent-thumbnail-image {
    transform: scale(1.05);
}

/* Desktop hover overlay */
.parent-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.parent-thumbnail::after {
    content: 'Click to view';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@media (hover: hover) {
    .parent-thumbnail:hover::before,
    .parent-thumbnail:hover::after {
        opacity: 1;
    }
}

/* Mobile persistent visual cue */
@media (hover: none) {
    .parent-thumbnail::after {
        content: '⤢';
        font-size: 1.5rem;
        top: auto;
        bottom: 12px;
        left: auto;
        right: 12px;
        transform: none;
        background: rgba(168, 85, 247, 0.95);
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0.9;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .parent-thumbnail:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3);
    }

    .parent-thumbnail:active::after {
        background: rgba(168, 85, 247, 1);
    }
}

.thumbnail-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Parent Detail Modal */
.parent-detail-modal {
    background: rgba(0, 0, 0, 0.6);
}

.parent-detail-content {
    position: relative;
    background: #f9fafb;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.parent-detail-scroll {
    overflow-y: auto;
    max-height: 90vh;
    padding: 60px 24px 24px;
}

@media (max-width: 768px) {
    .parent-detail-content {
        width: 95%;
        max-height: 95vh;
    }

    .parent-detail-scroll {
        padding: 50px 16px 16px;
    }
}

/* Parent Card Container */
.library-item {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.library-item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Parent Card */
.parent-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.parent-image-container {
    position: relative;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
    aspect-ratio: 3 / 4;
    background-size: cover;
    background-position: center top;
}

.parent-image-container:hover {
    transform: scale(1.02);
}

.parent-image-container img,
.parent-image-container video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
}

@media (max-width: 768px) {
    .parent-image-container {
        max-width: 100%;
        aspect-ratio: 4 / 5;
    }
}

.parent-info {
    text-align: center;
}

.parent-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.parent-metadata {
    font-size: 0.875rem;
    color: #6b7280;
}

.parent-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.parent-action-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.parent-action-btn:hover {
    transform: translateY(-2px);
}

.parent-action-btn.info-btn {
    background: #dbeafe;
    color: #1e40af;
}

.parent-action-btn.info-btn:hover {
    background: #bfdbfe;
}

.parent-action-btn.download-btn {
    background: #a855f7;
    color: white;
}

.parent-action-btn.download-btn:hover {
    background: #9333ea;
}

.parent-action-btn.edit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.parent-action-btn.edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.parent-action-btn.delete-btn {
    background: #fee2e2;
    color: #991b1b;
}

.parent-action-btn.delete-btn:hover {
    background: #fecaca;
}

@media (max-width: 768px) {
    .library-item {
        padding: 16px;
    }

    .parent-card {
        margin-bottom: 20px;
    }

    .parent-action-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* Variants Section */
.variants-section {
    border-top: 2px solid #e5e7eb;
    padding-top: 20px;
}

/* Variants Tabs */
.variants-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.variants-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.variants-tab:hover {
    color: #374151;
    background: #f9fafb;
}

.variants-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.variants-tab-content {
    display: none;
}

.variants-tab-content.active {
    display: block;
}

@media (max-width: 768px) {
    .variants-tab {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

.variants-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .variants-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

/* Variant Thumbnail Card */
.variant-thumbnail {
    position: relative;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1 / 1.2;
}

.variant-thumbnail:hover {
    border-color: #a855f7;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.2);
}

/* New variant persistent green glow */
.variant-thumbnail.variant-new {
    border: 3px solid #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6), 0 0 40px rgba(16, 185, 129, 0.4);
    animation: glowPulse 2s ease-in-out infinite;
    transform: translateY(-4px);
}

.variant-thumbnail.variant-new:hover {
    border-color: #059669;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.8), 0 0 60px rgba(16, 185, 129, 0.6);
}

.variant-thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.variant-info {
    padding: 12px;
}

.variant-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.variant-icon {
    font-size: 1.25rem;
}

.video-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.video-play-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Variant Overlay Actions */
.variant-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 12px;
}

.variant-thumbnail:hover .variant-overlay {
    opacity: 1;
}

.variant-action-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.variant-action-btn:hover {
    transform: scale(1.05);
}

.variant-action-btn.video-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.variant-action-btn.info-btn {
    background: #dbeafe;
    color: #1e40af;
}

.variant-action-btn.download-btn {
    background: #a855f7;
    color: white;
}

.variant-action-btn.delete-btn {
    background: #fee2e2;
    color: #991b1b;
}

/* Placeholder Card for Ungenerated Variants */
.placeholder-card {
    position: relative;
    background-color: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1.2;
    padding: 16px;
    text-align: center;
}

/* Blurred background image */
.placeholder-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: inherit;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    filter: blur(4px);
    z-index: 0;
}

.placeholder-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

/* Token Cost Badge on Placeholder Cards */
.token-cost-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(102, 126, 234, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    gap: 4px;
}

.token-cost-badge::before {
    content: "💎";
    font-size: 0.9rem;
}

/* Mobile-optimized token badge */
@media (max-width: 768px) {
    .token-cost-badge {
        top: 6px;
        left: 6px;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 0.65rem;
        gap: 2px;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    }

    .token-cost-badge::before {
        font-size: 0.7rem;
    }
}

.placeholder-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 1;
}

/* Placeholder spinner overlay */
.placeholder-spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    animation: fadeIn 0.2s ease;
}

.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
    min-width: 120px;
}

.generate-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile optimizations for placeholder cards */
@media (max-width: 768px) {
    .placeholder-card {
        padding: 0;
        cursor: pointer;
    }

    .generate-btn {
        /* Transform button into Netflix-style text overlay */
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
        color: white;
        border: none;
        border-radius: 0;
        padding: 16px 12px 12px 12px;
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        z-index: 2;
        box-shadow: none;
        white-space: normal;
        line-height: 1.3;
        text-align: center;
        min-width: auto;
        max-width: none;
        width: 100%;
        pointer-events: none;
    }

    /* Make entire card tappable on mobile */
    .placeholder-card {
        pointer-events: auto;
    }
}

.placeholder-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.placeholder-spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 0.8s linear infinite;
}

.placeholder-status {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Filter buttons */
.filter-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    background: white;
    border: 2px solid #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: #a855f7;
    color: #a855f7;
    background: #faf5ff;
}

.filter-btn.active {
    background: #a855f7;
    border-color: #a855f7;
    color: white;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

/* Hide overlay buttons on touch devices - use tap-to-open instead */
@media (hover: none) and (pointer: coarse) {
    .library-item-actions {
        display: none !important;
    }

    .library-item:hover {
        transform: none;
    }
}

/* Image Preview */
.image-preview {
    max-width: 100%;
    max-height: 500px;
    height: auto;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Result Image - Initial Generation Display */
.result-image {
    max-width: 100%;
    max-height: calc(100vh - 300px);
    height: auto;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Comparison Slider */
.comparison-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Utility Classes */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .upload-zone {
        padding: 2rem 1rem;
    }

    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .library-item img {
        height: 150px;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .result-image {
        max-height: calc(100vh - 400px);
    }

    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    /* Mobile Header Optimization - Minimal & Clean */
    .gradient-bg > div:first-child {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    /* Dramatically reduce hero heading size on mobile */
    .gradient-bg h1 {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.75rem !important;
    }

    /* Condense tagline on mobile */
    .hero-tagline {
        font-size: 1rem !important;
        line-height: 1.4 !important;
        max-width: 85% !important;
        margin: 0 auto !important;
    }

    /* Admin Settings link - smaller on mobile */
    .gradient-bg a {
        font-size: 0.875rem !important;
    }

    /* Glass card - better padding on mobile */
    .glass-card {
        padding: 1.25rem !important;
        margin-top: 1rem !important;
    }

    /* Tab navigation - better touch targets */
    .tab-button {
        padding: 0.875rem 1rem !important;
        font-size: 0.9rem !important;
        min-height: 44px !important;
    }

    /* Tool cards - better mobile sizing */
    .tool-card {
        padding: 24px !important;
    }

    .tool-icon {
        width: 64px !important;
        height: 64px !important;
        margin-bottom: 16px !important;
    }

    .tool-title {
        font-size: 1.25rem !important;
    }

    .tool-description {
        font-size: 0.9rem !important;
    }
}

/* Extra Small Mobile Screens - iPhone SE, smaller phones */
@media (max-width: 375px) {
    /* Even more compact hero on very small screens */
    .gradient-bg h1 {
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
    }

    .hero-tagline {
        font-size: 0.9rem !important;
    }

    .glass-card {
        padding: 1rem !important;
        border-radius: 12px !important;
    }

    .tab-button {
        padding: 0.75rem 0.75rem !important;
        font-size: 0.85rem !important;
    }

    .tool-card {
        padding: 20px !important;
    }

    .tool-icon {
        width: 56px !important;
        height: 56px !important;
    }

    .tool-title {
        font-size: 1.1rem !important;
    }
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #667eea;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Lightbox Navigation */
#prevImageBtn:disabled,
#nextImageBtn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#prevImageBtn:not(:disabled):hover,
#nextImageBtn:not(:disabled):hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Lightbox Image Transitions */
#lightboxImage {
    transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out;
}

#lightboxImage.slide-out-left {
    animation: slideOutLeft 0.25s ease-in-out;
}

#lightboxImage.slide-out-right {
    animation: slideOutRight 0.25s ease-in-out;
}

#lightboxImage.slide-in-left {
    animation: slideInLeft 0.25s ease-in-out;
}

#lightboxImage.slide-in-right {
    animation: slideInRight 0.25s ease-in-out;
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30%);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Lightbox Action Buttons - Responsive */
#imageLightbox .absolute.bottom-20 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90%;
    left: 50%;
    transform: translateX(-50%);
}

@media (max-width: 640px) {
    /* Stack buttons vertically on mobile */
    #imageLightbox .absolute.bottom-20 {
        flex-direction: column;
        bottom: 4rem;
        gap: 0.5rem;
    }

    #imageLightbox .absolute.bottom-20 button {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
        width: 100%;
        max-width: 280px;
    }

    /* Adjust image counter position on mobile */
    #imageLightbox .absolute.bottom-8 {
        bottom: 0.5rem;
    }

    /* Reduce image max height on mobile to accommodate buttons */
    #lightboxImage {
        max-height: calc(100vh - 240px) !important;
    }
}

/* ========================================
   SIMPLE LIGHTBOX - MINIMAL VIEWER
   ======================================== */

/* Gradient background with depth */
.lightbox-gradient-bg {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    animation: fadeIn 0.3s ease;
}

/* Simple close button */
.glass-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Simple download button */
.simple-download-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.simple-download-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.3);
}

/* Lightbox title */
.lightbox-title {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    padding: 8px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

@media (max-width: 640px) {
    .glass-button {
        width: 42px;
        height: 42px;
    }

    .glass-button svg {
        width: 20px;
        height: 20px;
    }

    .simple-download-btn {
        padding: 10px 18px;
        font-size: 0.85rem;
    }

    .lightbox-title {
        font-size: 0.8rem;
        padding: 6px 16px;
    }

    #lightboxImage {
        border-radius: 16px !important;
    }
}

/* ========================================
   EDIT MODAL - PRESET SELECTOR
   ======================================== */

.edit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.edit-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.edit-modal-header {
    margin-bottom: 24px;
}

.edit-modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.edit-modal-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
}

.edit-presets-category {
    margin-bottom: 32px;
}

.edit-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.edit-preset-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.edit-preset-card:hover {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-color: #a855f7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

.edit-preset-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.edit-preset-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.edit-preset-desc {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.3;
    margin: 0;
}

.edit-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

/* Mobile responsive */
@media (max-width: 640px) {
    .edit-modal-content {
        padding: 24px;
        max-width: 95%;
        border-radius: 20px;
    }

    .edit-presets-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .edit-preset-card {
        padding: 12px;
    }

    .edit-preset-icon {
        font-size: 1.5rem;
    }

    .edit-modal-title {
        font-size: 1.25rem;
    }
}

/* Comparison Slider */
.comparison-slider-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.comparison-slider-container {
    position: relative;
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    cursor: ew-resize;
    user-select: none;
    -webkit-user-select: none;
}

.comparison-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    pointer-events: none;
}

.comparison-after {
    position: relative;
    z-index: 1;
}

.comparison-before {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

.comparison-slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: white;
    transform: translateX(-50%);
    z-index: 3;
    cursor: ew-resize;
}

.comparison-slider-line {
    width: 100%;
    height: 100%;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.comparison-slider-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.comparison-slider-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.comparison-slider-button svg {
    color: #667eea;
}

.comparison-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding: 0 8px;
}

.comparison-label-before,
.comparison-label-after {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .comparison-slider-button {
        width: 40px;
        height: 40px;
    }

    .comparison-slider-button svg {
        width: 20px;
        height: 20px;
    }
}

/* Quick Variations Modal */
.quick-variations-modal {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    margin-bottom: 24px;
}

.presets-checkbox-grid {
    margin-bottom: 24px;
}

.preset-category {
    margin-bottom: 24px;
}

.preset-category:last-child {
    margin-bottom: 0;
}

.preset-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.preset-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.preset-checkbox-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.preset-checkbox-item:hover {
    border-color: #a855f7;
    background: #faf5ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
}

.preset-checkbox-item input[type="checkbox"] {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #a855f7;
}

.preset-checkbox-item input[type="checkbox"]:checked + .preset-checkbox-icon + .preset-checkbox-label {
    color: #a855f7;
    font-weight: 600;
}

.preset-checkbox-item input[type="checkbox"]:checked ~ * {
    color: #a855f7;
}

.preset-checkbox-item:has(input:checked) {
    border-color: #a855f7;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

.preset-checkbox-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    transition: transform 0.2s ease;
}

.preset-checkbox-item:hover .preset-checkbox-icon {
    transform: scale(1.1);
}

.preset-checkbox-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    text-align: center;
    transition: all 0.2s ease;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

/* Success Notification */
.success-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
    font-weight: 600;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
    animation: slideInRight 0.3s ease;
}

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

@media (max-width: 640px) {
    .quick-variations-modal {
        padding: 24px;
        max-width: 95%;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .preset-items {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    .preset-checkbox-item {
        padding: 12px 8px;
    }

    .preset-checkbox-icon {
        font-size: 1.5rem;
    }

    .preset-checkbox-label {
        font-size: 0.75rem;
    }
}

/* ========================================
   ADMIN DASHBOARD STYLES
   ======================================== */

/* Admin Toast Animations */
@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.admin-toast {
    animation: toastSlideIn 0.3s ease;
}

/* Admin Table Hover Effects */
.admin-table-row {
    transition: all 0.2s ease;
}

.admin-table-row:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* Admin Badge Styles */
.admin-badge-glow {
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

/* Admin Action Button Group */
.admin-action-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Admin Card Hover */
.admin-stat-card {
    transition: all 0.3s ease;
}

.admin-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Admin Search Input Focus */
.admin-search-input:focus {
    ring: 2px;
    ring-color: #a855f7;
    border-color: #a855f7;
}

/* Admin Modal Backdrop Blur */
.admin-modal-backdrop {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Admin Table Checkbox Styling */
.admin-checkbox {
    cursor: pointer;
    accent-color: #a855f7;
    width: 1.125rem;
    height: 1.125rem;
}

.admin-checkbox:checked {
    background-color: #a855f7;
    border-color: #a855f7;
}

/* Admin Select Dropdown */
.admin-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5rem;
    padding-right: 2.5rem;
}

/* Admin Empty State */
.admin-empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: #9ca3af;
}

.admin-empty-state svg {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* Admin Loading State */
.admin-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

/* Admin Pagination */
.admin-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.admin-pagination-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-pagination-btn:hover:not(:disabled) {
    background: rgba(168, 85, 247, 0.3);
    border-color: rgba(168, 85, 247, 0.5);
}

.admin-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-pagination-btn.active {
    background: rgba(168, 85, 247, 0.5);
    border-color: rgba(168, 85, 247, 0.7);
}

/* Admin Grid Layout for Library Items */
.admin-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .admin-library-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
}

/* Admin Form Input Styles */
.admin-form-input {
    transition: all 0.2s ease;
}

.admin-form-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

/* Admin Status Indicator */
.admin-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.admin-status-dot.online {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.admin-status-dot.offline {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* Admin Tooltip */
.admin-tooltip {
    position: relative;
}

.admin-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 0.5rem;
}

/* Admin Scrollbar Styling */
.admin-scrollable::-webkit-scrollbar {
    width: 8px;
}

.admin-scrollable::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.admin-scrollable::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.5);
    border-radius: 4px;
}

.admin-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.7);
}

/* Admin Gradient Text */
.admin-gradient-text {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   AUTH LOADING SPINNER
   ======================================== */

.auth-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 16px;
    gap: 16px;
}

.auth-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.auth-loading-text {
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
    text-align: center;
}

.auth-loading-subtext {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
}

/* ========================================
   AUTH SUCCESS TOAST NOTIFICATION
   ======================================== */

@keyframes toastSlideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastSlideOutToTop {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.auth-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 10001;
    max-width: 400px;
    animation: toastSlideInFromTop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: start;
    gap: 16px;
}

.auth-toast.hiding {
    animation: toastSlideOutToTop 0.3s ease-in-out forwards;
}

.auth-toast-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-toast-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.auth-toast-content {
    flex: 1;
}

.auth-toast-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: white;
}

.auth-toast-message {
    font-size: 0.875rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.95);
}

.auth-toast-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    flex-shrink: 0;
}

.auth-toast-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

@media (max-width: 640px) {
    .auth-toast {
        top: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
        padding: 16px 20px;
    }
}

/* ========================================
   MOBILE USER MENU - HAMBURGER SLIDE-OUT
   ======================================== */

/* Hamburger menu button - hidden on desktop */
.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    color: #4f46e5;
}

/* Slide-out menu panel */
.mobile-user-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.98) 0%, rgba(118, 75, 162, 0.98) 100%);
    backdrop-filter: blur(20px);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
    z-index: 10002;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 24px;
    overflow-y: auto;
}

.mobile-user-panel.active {
    right: 0;
}

/* Panel backdrop overlay */
.mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Panel header */
.mobile-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-panel-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.mobile-panel-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.mobile-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Panel content sections */
.mobile-panel-section {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.mobile-panel-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.mobile-panel-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-panel-username {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.mobile-panel-logout {
    width: 100%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.mobile-panel-logout:active {
    background: rgba(220, 38, 38, 0.9);
    transform: scale(0.98);
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    /* Show hamburger menu on mobile */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Hide username and logout button on mobile (keep in DOM for desktop) */
    #userMenu span,
    #userMenu button {
        display: none !important;
    }

    /* Make token badge more compact on mobile */
    .token-badge {
        padding: 8px 14px;
        font-size: 0.95rem;
        gap: 6px;
    }

    .token-badge svg {
        width: 18px;
        height: 18px;
    }

    /* Adjust fixed header positioning */
    .fixed.top-6.right-6 {
        top: 1rem;
        right: 1rem;
        gap: 0.5rem;
    }
}

@media (max-width: 375px) {
    /* Even more compact on very small screens */
    .token-badge {
        padding: 6px 12px;
        font-size: 0.875rem;
    }

    .mobile-user-panel {
        width: 100%;
        max-width: 280px;
    }
}

/* Admin Quick Actions Menu */
.admin-quick-actions {
    position: relative;
}

.admin-quick-actions-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem;
    min-width: 12rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.admin-quick-action-item {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #d1d5db;
}

.admin-quick-action-item:hover {
    background: rgba(168, 85, 247, 0.2);
    color: white;
}
