/* Gallery Management Styles with Storage Management - Professional Author Image Management */

:root {
    --gallery-primary: #2C5282;
    --gallery-secondary: #FFAB02;
    --gallery-success: #48BB78;
    --gallery-warning: #ED8936;
    --gallery-error: #E53E3E;
    --gallery-bg: #F7FAFC;
    --gallery-card: #FFFFFF;
    --gallery-border: #E2E8F0;
    --gallery-text: #2D3748;
    --gallery-text-light: #718096;
    --gallery-shadow: rgba(0, 0, 0, 0.1);
    --gallery-shadow-hover: rgba(0, 0, 0, 0.15);
    
    /* Gallery-specific colors */
    --gallery-accent: #805AD5;
    --gallery-gradient: linear-gradient(135deg, var(--gallery-primary), var(--gallery-accent));
    
    /* Storage plan colors */
    --storage-basic: #48BB78;
    --storage-professional: #4299E1;
    --storage-creator: #805AD5;
    --storage-enterprise: #E53E3E;
}

/* Base Styles */
body {
    background: var(--gallery-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
}

/* Navigation - Inherited from shared patterns */
.nav {
    background: var(--gallery-card);
    border-bottom: 1px solid var(--gallery-border);
    box-shadow: 0 2px 10px var(--gallery-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-title {
    color: var(--gallery-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--gallery-text);
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--gallery-border);
    color: var(--gallery-primary);
}

.nav-link.active {
    background: var(--gallery-primary);
    color: white;
}

.back-to-site {
    background: var(--gallery-secondary);
    color: white !important;
    font-weight: 600;
}

.back-to-site:hover {
    background: #E69500;
}

.auth-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--gallery-error);
    text-decoration: none;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.auth-nav-link:hover {
    background: rgba(229, 62, 62, 0.1);
}

/* Mobile Toggle - Hidden by default, shown on mobile or with 5+ features */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Show hamburger when customer has 5+ features (even on desktop) */
.nav-container.has-many-features .mobile-toggle {
    display: flex;
}

/* Show hamburger when customer has 5+ features, hide some nav links on desktop */
.nav-container.has-many-features .nav-links {
    display: flex;
}

@media (min-width: 769px) {
    .nav-container.has-many-features .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--gallery-card);
        border-top: 1px solid var(--gallery-border);
        box-shadow: 0 2px 10px var(--gallery-shadow);
        flex-direction: column;
        padding: 1rem 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }
    
    .nav-container.has-many-features .nav-links.active {
        transform: translateX(0);
    }
    
    .nav-container.has-many-features .nav-link {
        width: 100%;
        text-align: center;
        padding: 1rem;
        border-radius: 0;
    }
}

.mobile-toggle span {
    width: 100%;
    height: 3px;
    background: var(--gallery-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Main Gallery Container */
.gallery-main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 70px);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gallery-border);
    border-top: 4px solid var(--gallery-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Access State */
.no-access-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}

.access-prompt {
    text-align: center;
    background: var(--gallery-card);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px var(--gallery-shadow);
    max-width: 600px;
}

.access-prompt h2 {
    color: var(--gallery-primary);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.feature-benefits {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
    text-align: left;
}

.benefit {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gallery-bg);
    border-radius: 12px;
}

.benefit-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.benefit h4 {
    margin: 0 0 0.5rem 0;
    color: var(--gallery-primary);
}

.benefit p {
    margin: 0;
    color: var(--gallery-text-light);
}

.upgrade-btn {
    background: var(--gallery-gradient);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(128, 90, 213, 0.3);
}

/* Gallery Panel */
.gallery-panel {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Gallery Header */
.gallery-header {
    background: var(--gallery-card);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--gallery-shadow);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content h1 {
    color: var(--gallery-primary);
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.header-content p {
    color: var(--gallery-text-light);
    margin: 0;
    font-size: 1.1rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.primary-btn {
    background: var(--gallery-gradient);
    color: white;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(128, 90, 213, 0.3);
}

.secondary-btn {
    background: white;
    color: var(--gallery-primary);
    border: 2px solid var(--gallery-border);
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    border-color: var(--gallery-primary);
    background: rgba(44, 82, 130, 0.05);
    transform: translateY(-1px);
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: var(--gallery-card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--gallery-shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--gallery-shadow-hover);
}

.stat-item.storage-stat {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.stat-item.storage-stat:hover {
    background: rgba(128, 90, 213, 0.05);
    border: 2px solid var(--gallery-accent);
}

.stat-item.storage-stat.storage-warning {
    background: rgba(237, 137, 54, 0.1);
    border: 2px solid var(--gallery-warning);
}

.stat-item.storage-stat.storage-warning:hover {
    background: rgba(237, 137, 54, 0.15);
}

.stat-item.storage-stat.storage-critical {
    background: rgba(229, 62, 62, 0.1);
    border: 2px solid var(--gallery-error);
    animation: pulseRed 2s infinite;
}

.stat-item.storage-stat.storage-critical:hover {
    background: rgba(229, 62, 62, 0.15);
}

@keyframes pulseRed {
    0% { box-shadow: 0 4px 20px var(--gallery-shadow); }
    50% { box-shadow: 0 4px 20px rgba(229, 62, 62, 0.4); }
    100% { box-shadow: 0 4px 20px var(--gallery-shadow); }
}

.storage-clickable {
    color: var(--gallery-accent);
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
    display: block;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--gallery-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gallery-text-light);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

/* Upgrade Confirmation Modal */
.upgrade-confirm-modal {
    max-width: 600px;
    width: 90vw;
}

.upgrade-confirm-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.current-plan-info h4,
.new-plan-info h4 {
    margin: 0 0 1rem 0;
    color: var(--gallery-text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.plan-display {
    background: var(--gallery-bg);
    border: 2px solid var(--gallery-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.new-plan-info .plan-display {
    border-color: var(--gallery-primary);
    background: rgba(44, 82, 130, 0.05);
    box-shadow: 0 4px 15px rgba(44, 82, 130, 0.1);
}

.plan-name {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gallery-primary);
    margin-bottom: 0.5rem;
}

.plan-price {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gallery-text);
    margin-bottom: 0.25rem;
}

.plan-storage {
    display: block;
    font-size: 0.9rem;
    color: var(--gallery-text-light);
}

.upgrade-arrow {
    font-size: 2rem;
    color: var(--gallery-primary);
    font-weight: bold;
    text-align: center;
}

.upgrade-details {
    background: rgba(128, 90, 213, 0.05);
    border: 1px solid rgba(128, 90, 213, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
}

.upgrade-details p {
    margin: 0 0 1.5rem 0;
    color: var(--gallery-text);
    font-weight: 500;
    text-align: center;
}

.upgrade-benefits {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gallery-text);
    font-size: 0.9rem;
}

.benefit-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.btn-spinner {
    animation: spin 1s linear infinite;
    font-size: 1.2rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .upgrade-confirm-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    .upgrade-arrow {
        transform: rotate(90deg);
        font-size: 1.5rem;
    }
    
    .plan-display {
        padding: 1rem;
    }
    
    .plan-name {
        font-size: 1.1rem;
    }
    
    .plan-price {
        font-size: 1.25rem;
    }
}

.storage-current {
    background: var(--gallery-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.storage-current h4 {
    margin: 0 0 1rem 0;
    color: var(--gallery-primary);
    font-size: 1.25rem;
}

.storage-usage-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.storage-bar-large {
    height: 20px;
    background: var(--gallery-border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.storage-fill-large {
    height: 100%;
    background: var(--gallery-success);
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.storage-fill-large.warning {
    background: var(--gallery-warning);
}

.storage-fill-large.critical {
    background: var(--gallery-error);
}

.storage-text {
    text-align: center;
    font-weight: 600;
    color: var(--gallery-text);
    font-size: 1.1rem;
}

/* Storage Plans */
.storage-plans {
    margin: 2rem 0;
}

.storage-plans h4 {
    margin: 0 0 0.5rem 0;
    color: var(--gallery-primary);
    font-size: 1.25rem;
}

.plan-description {
    color: var(--gallery-text-light);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.storage-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.storage-plan {
    background: var(--gallery-card);
    border: 2px solid var(--gallery-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.storage-plan:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--gallery-shadow-hover);
}

.storage-plan[data-plan="basic"] {
    border-color: var(--storage-basic);
}

.storage-plan[data-plan="professional"] {
    border-color: var(--storage-professional);
}

.storage-plan[data-plan="creator"] {
    border-color: var(--storage-creator);
}

.storage-plan[data-plan="enterprise"] {
    border-color: var(--storage-enterprise);
}

.plan-header {
    padding: 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, var(--gallery-bg), white);
}

.plan-header.basic {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1), white);
}

.plan-header.professional {
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.1), white);
}

.plan-header.creator {
    background: linear-gradient(135deg, rgba(128, 90, 213, 0.1), white);
}

.plan-header.enterprise {
    background: linear-gradient(135deg, rgba(229, 62, 62, 0.1), white);
}

.plan-header h5 {
    margin: 0 0 1rem 0;
    color: var(--gallery-text);
    font-size: 1.5rem;
    font-weight: 700;
}

.plan-price {
    margin-bottom: 0.5rem;
}

.price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gallery-primary);
}

.period {
    font-size: 1rem;
    color: var(--gallery-text-light);
}

.included-note {
    color: var(--storage-basic);
    font-weight: 600;
    background: rgba(72, 187, 120, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    display: inline-block;
}

.upgrade-note {
    color: var(--gallery-text-light);
    font-size: 0.875rem;
}

.plan-features {
    padding: 1.5rem;
    border-top: 1px solid var(--gallery-border);
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--gallery-text);
    font-size: 0.9rem;
    line-height: 1.4;
}

.feature:last-child {
    margin-bottom: 0;
}

.plan-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    border-radius: 0 0 14px 14px;
}

.current-plan {
    background: var(--gallery-border);
    color: var(--gallery-text-light);
    cursor: not-allowed;
}

.upgrade-btn {
    background: var(--gallery-gradient);
    color: white;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(128, 90, 213, 0.4);
}

.downgrade-btn {
    background: var(--gallery-warning);
    color: white;
}

.downgrade-btn:hover {
    background: #E69500;
}

/* Storage Tips */
.storage-tips {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--gallery-bg);
    border-radius: 12px;
}

.storage-tips h4 {
    margin: 0 0 1.5rem 0;
    color: var(--gallery-primary);
    font-size: 1.25rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.tip {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--gallery-accent);
}

.tip-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.tip strong {
    color: var(--gallery-primary);
}

/* Storage Impact Preview */
.storage-impact-preview {
    background: rgba(66, 153, 225, 0.05);
    border: 1px solid rgba(66, 153, 225, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.impact-header {
    font-weight: 600;
    color: var(--gallery-primary);
    margin-bottom: 0.75rem;
}

.impact-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.impact-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.impact-total {
    font-weight: 600;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(66, 153, 225, 0.2);
    margin-top: 0.5rem;
}

/* Storage Limit Modal */
.storage-limit-modal {
    max-width: 700px;
}

.error-message {
    background: rgba(229, 62, 62, 0.1);
    border: 1px solid rgba(229, 62, 62, 0.3);
    color: var(--gallery-error);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.upgrade-options {
    margin: 1.5rem 0;
}

.upgrade-options h4 {
    margin: 0 0 1rem 0;
    color: var(--gallery-primary);
}

.upgrade-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border: 1px solid var(--gallery-border);
    border-radius: 12px;
    margin-bottom: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.upgrade-option:hover {
    border-color: var(--gallery-accent);
    background: rgba(128, 90, 213, 0.02);
}

.plan-info {
    flex: 1;
}

.plan-name {
    font-weight: 600;
    color: var(--gallery-primary);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.plan-storage {
    color: var(--gallery-text);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.plan-capacity {
    color: var(--gallery-text-light);
    font-size: 0.875rem;
}

.plan-pricing {
    text-align: center;
    margin: 0 1rem;
}

.plan-price {
    font-weight: 700;
    color: var(--gallery-primary);
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.plan-pricing small {
    color: var(--gallery-text-light);
    font-size: 0.8rem;
}

.storage-help {
    background: rgba(72, 187, 120, 0.1);
    border: 1px solid rgba(72, 187, 120, 0.3);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.storage-help p {
    margin: 0;
    color: var(--gallery-text);
}

/* Search and Filter Bar */
.search-filter-bar {
    background: var(--gallery-card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--gallery-shadow);
    margin-bottom: 2rem;
}

.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    border: 2px solid var(--gallery-border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: var(--gallery-primary);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gallery-text-light);
    font-size: 1.2rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gallery-border);
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--gallery-primary);
}

.clear-filters {
    background: var(--gallery-error);
    color: white;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-filters:hover {
    background: #C53030;
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    background: var(--gallery-accent);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(128, 90, 213, 0.3);
}

.bulk-selection-info {
    font-weight: 600;
    font-size: 1.1rem;
}

.bulk-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bulk-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bulk-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.bulk-btn.delete-btn {
    background: var(--gallery-error);
    border-color: var(--gallery-error);
}

.bulk-btn.delete-btn:hover {
    background: #C53030;
}

/* Gallery Container */
.gallery-container {
    min-height: 400px;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Gallery List View */
.gallery-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.gallery-list .image-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--gallery-card);
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--gallery-shadow);
}

.gallery-list .image-thumbnail {
    width: 100px;
    height: 100px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.gallery-list .image-info {
    flex: 1;
}

/* Image Card */
.image-card {
    background: var(--gallery-card);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--gallery-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--gallery-shadow-hover);
}

.image-card.selected {
    border: 3px solid var(--gallery-accent);
    box-shadow: 0 8px 30px rgba(128, 90, 213, 0.3);
}

/* Image Selection */
.image-selection {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 3;
}

.image-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid white;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
}

.image-checkbox:checked {
    background: var(--gallery-accent);
    border-color: var(--gallery-accent);
}

.image-checkbox:checked::after {
    content: "✓";
    color: white;
    font-size: 14px;
    font-weight: bold;
    position: absolute;
    top: -2px;
    left: 2px;
}

/* Image Thumbnail */
.image-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.image-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Image Overlay */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

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

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--gallery-text);
}

.action-btn:hover {
    background: white;
    transform: scale(1.1);
}

.edit-btn:hover {
    color: var(--gallery-success);
}

.duplicate-btn:hover {
    color: var(--gallery-primary);
}

.delete-btn:hover {
    color: var(--gallery-error);
}

/* Image Info */
.image-info {
    padding: 1.25rem;
}

.image-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.image-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gallery-text);
    line-height: 1.3;
    flex: 1;
    margin-right: 0.5rem;
}

.image-badges {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.public {
    background: rgba(72, 187, 120, 0.1);
    color: var(--gallery-success);
}

.badge.private {
    background: rgba(113, 128, 150, 0.1);
    color: var(--gallery-text-light);
}

.badge.featured {
    background: rgba(255, 171, 2, 0.1);
    color: var(--gallery-secondary);
}

.image-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--gallery-text-light);
}

.category-badge {
    background: var(--gallery-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.image-description {
    margin: 0.75rem 0;
    color: var(--gallery-text-light);
    line-height: 1.4;
    font-size: 0.9rem;
}

.image-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.tag {
    background: rgba(128, 90, 213, 0.1);
    color: var(--gallery-accent);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag.more {
    background: var(--gallery-border);
    color: var(--gallery-text-light);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--gallery-card);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--gallery-shadow);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state h3 {
    color: var(--gallery-primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.empty-state p {
    color: var(--gallery-text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--gallery-card);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

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

.upload-modal {
    max-width: 800px;
    width: 90vw;
}

.edit-modal {
    max-width: 900px;
    width: 90vw;
}

.bulk-edit-modal {
    max-width: 600px;
    width: 90vw;
}

.delete-modal {
    max-width: 500px;
    width: 90vw;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gallery-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--gallery-primary);
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gallery-text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: var(--gallery-border);
    color: var(--gallery-text);
}

.modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gallery-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Upload Zone Styles */
.upload-zone {
    border: 3px dashed var(--gallery-border);
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 2rem;
}

.upload-zone:hover {
    border-color: var(--gallery-primary);
    background: rgba(44, 82, 130, 0.02);
}

.upload-zone.dragover {
    border-color: var(--gallery-success);
    background: rgba(72, 187, 120, 0.1);
}

.upload-placeholder {
    padding: 3rem 2rem;
    text-align: center;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.upload-placeholder h4 {
    margin: 0 0 0.5rem 0;
    color: var(--gallery-primary);
    font-size: 1.5rem;
}

.upload-placeholder p {
    margin: 0.5rem 0;
    color: var(--gallery-text);
    font-size: 1.1rem;
}

.upload-placeholder small {
    color: var(--gallery-text-light);
    display: block;
    margin: 1rem 0;
}

.browse-btn {
    background: var(--gallery-gradient);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(128, 90, 213, 0.3);
}

/* Upload Queue Styles */
.upload-queue {
    margin: 2rem 0;
    background: var(--gallery-bg);
    border-radius: 12px;
    padding: 1.5rem;
}

.upload-queue h4 {
    margin: 0 0 1rem 0;
    color: var(--gallery-primary);
}

.queue-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--gallery-border);
}

.queue-preview {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.queue-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.queue-info {
    flex: 1;
}

.queue-filename {
    font-weight: 600;
    color: var(--gallery-text);
    margin-bottom: 0.25rem;
}

.queue-size {
    font-size: 0.875rem;
    color: var(--gallery-text-light);
    margin-bottom: 0.5rem;
}

.queue-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--gallery-border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gallery-success);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--gallery-text-light);
    min-width: 80px;
    text-align: right;
}

.remove-queue-item {
    background: var(--gallery-error);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.3s ease;
}

.remove-queue-item:hover {
    background: #C53030;
}

/* Bulk Metadata Styles */
.bulk-metadata {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(128, 90, 213, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(128, 90, 213, 0.2);
}

.bulk-metadata h4 {
    margin: 0 0 1rem 0;
    color: var(--gallery-accent);
}

/* Form Styles */
.edit-form {
    max-width: none;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gallery-text);
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--gallery-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: white;
    color: var(--gallery-text);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gallery-primary);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
    background: white;
}

.form-group small {
    color: var(--gallery-text-light);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}

/* Image Preview Section */
.image-preview-section {
    margin-bottom: 2rem;
}

.image-preview-container {
    text-align: center;
}

.edit-image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--gallery-shadow);
    margin-bottom: 1rem;
}

.image-info {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gallery-text-light);
    flex-wrap: wrap;
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    margin-bottom: 1rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkmark {
    position: relative;
    height: 20px;
    width: 20px;
    background-color: white;
    border: 2px solid var(--gallery-border);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: var(--gallery-primary);
    border-color: var(--gallery-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark:after {
    content: "✓";
    position: absolute;
    left: 3px;
    top: -2px;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Bulk Edit Options */
.bulk-edit-options {
    background: var(--gallery-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.visibility-options {
    margin-left: 2rem;
    margin-top: 0.5rem;
}

/* Delete Preview */
.delete-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--gallery-bg);
    border-radius: 8px;
}

.delete-preview img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
}

/* Button Variants */
.danger-btn {
    background: var(--gallery-error);
    color: white;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.danger-btn:hover {
    background: #C53030;
    transform: translateY(-1px);
}

/* Warning Text */
.warning-text {
    color: var(--gallery-error);
    font-weight: 500;
    font-style: italic;
}

/* Notification */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: var(--gallery-card);
    border-radius: 12px;
    box-shadow: 0 8px 30px var(--gallery-shadow);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
    border-left: 4px solid var(--gallery-primary);
}

.notification.success {
    border-left-color: var(--gallery-success);
}

.notification.error {
    border-left-color: var(--gallery-error);
}

.notification.warning {
    border-left-color: var(--gallery-warning);
}

.notification.active {
    transform: translateX(0);
}

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

.notification-message {
    color: var(--gallery-text);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Always show hamburger on mobile */
    .mobile-toggle {
        display: flex !important;
    }
    
    /* Mobile navigation menu */
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--gallery-card);
        border-top: 1px solid var(--gallery-border);
        box-shadow: 0 2px 10px var(--gallery-shadow);
        flex-direction: column;
        padding: 1rem 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }
    
    .nav-links.active {
        transform: translateX(0);
    }
    
    .nav-link {
        width: 100%;
        text-align: center;
        padding: 1rem;
        border-radius: 0;
    }
    
    .gallery-main {
        padding: 1rem;
    }
    
    .gallery-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 1.5rem;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bulk-actions-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .bulk-actions {
        justify-content: center;
    }
    
    .modal-content {
        margin: 0.5rem;
        width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .notification.active {
        transform: translateY(0);
    }
    
    /* Storage modal mobile adjustments */
    .storage-plan-grid {
        grid-template-columns: 1fr;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .upgrade-option {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-header {
        padding: 1rem;
    }
    
    .header-content h1 {
        font-size: 1.75rem;
    }
    
    .stats-bar {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .search-filter-bar {
        padding: 1rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .upload-placeholder {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .queue-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .queue-preview {
        width: 100%;
        height: 150px;
    }
    
    .bulk-actions {
        flex-direction: column;
    }
    
    .notification {
        left: 5px;
        right: 5px;
        font-size: 0.8rem;
    }
    
    .image-info {
        justify-content: flex-start;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Storage modal very small screen adjustments */
    .storage-modal {
        width: 98vw;
        margin: 1%;
    }
    
    .plan-header {
        padding: 1rem;
    }
    
    .plan-features {
        padding: 1rem;
    }
    
    .price {
        font-size: 2rem;
    }
}

/* Print Styles */
@media print {
    .gallery-main {
        padding: 0;
    }
    
    .modal-overlay,
    .notification,
    .header-actions,
    .image-actions,
    .search-filter-bar,
    .bulk-actions-bar {
        display: none !important;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .image-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--gallery-border);
    }
    
    .image-overlay {
        display: none !important;
    }
}

/* ==============================================
   IMAGE REUSE (SHARED IMAGE SELECTOR)
   ============================================== */

.image-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--gallery-border);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--gallery-text-light);
    transition: all 0.2s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--gallery-primary);
    background: rgba(44, 82, 130, 0.05);
}

.tab-btn.active {
    color: var(--gallery-primary);
    border-bottom-color: var(--gallery-primary);
}

.reuse-hint {
    color: var(--gallery-text-light);
    font-size: 0.875rem;
    margin: 0 0 1rem 0;
    padding: 0.75rem 1rem;
    background: rgba(44, 82, 130, 0.05);
    border-radius: 6px;
    border-left: 3px solid var(--gallery-primary);
}

.existing-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--gallery-bg);
    border-radius: 8px;
    border: 1px solid var(--gallery-border);
}

.existing-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    background: white;
}

.existing-image-item:hover {
    border-color: var(--gallery-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--gallery-shadow-hover);
}

.existing-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.existing-image-item .image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 0.5rem;
    color: white;
}

.existing-image-item .image-title {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.existing-image-item .image-type {
    font-size: 0.65rem;
    opacity: 0.8;
}

.reuse-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--gallery-primary);
    color: white;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s;
}

.existing-image-item:hover .reuse-badge {
    opacity: 1;
}

.loading-images,
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--gallery-text-light);
}

.existing-images-grid .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
}

.existing-images-grid .empty-state p {
    color: var(--gallery-text-light);
    margin: 0.5rem 0;
}
}