/* Tool-specific overrides */
:root {
    --accent-color: #5E5CE6;
    /* Electric Indigo */
    --accent-hover: #4A48C8;
}

.app-shell {
    max-width: 1200px !important;
    width: 100%;
}



/* Stats Section */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius-small);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(94, 92, 230, 0.2);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-value.danger {
    color: var(--error-color);
}

.stat-value.warning {
    color: var(--warning-color);
}

.stat-value.success {
    color: var(--success-color);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.image-card {
    background: var(--card-bg);
    border-radius: var(--radius-small);
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(94, 92, 230, 0.4);
}

.image-preview-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-color);
    cursor: pointer;
}

.image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-danger {
    background: #FFF2F2;
    color: #FF3B30;
    border: 1px solid rgba(255, 59, 48, 0.1);
}

.badge-warning {
    background: #FFF9F2;
    color: #FF9500;
    border: 1px solid rgba(255, 149, 0, 0.1);
}

.badge-info {
    background: #F2F7FF;
    color: #007AFF;
    border: 1px solid rgba(0, 122, 255, 0.1);
}

.badge-success {
    background: #F2FFF5;
    color: #34C759;
    border: 1px solid rgba(52, 199, 89, 0.1);
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.action-btn-sm {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-align: center;
}

.btn-view {
    background: var(--icon-box-bg);
    color: var(--accent-color);
}

.btn-view:hover {
    background: var(--icon-box-bg-hover);
}

.btn-download-sm {
    background: var(--accent-color);
    color: white;
}

.btn-download-sm:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(94, 92, 230, 0.2);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    padding: 20px;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-default);
    max-width: 1100px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    display: flex;
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border-light);
}

@media (max-width: 900px) {
    .modal-content {
        flex-direction: column;
        max-height: 95vh;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-color);
    transform: rotate(90deg);
}

.modal-image-section {
    flex: 1.2;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 300px;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-sidebar {
    flex: 0.8;
    padding: 40px;
    overflow-y: auto;
    border-left: 1px solid var(--border-light);
    background: var(--card-bg);
}

@media (max-width: 900px) {
    .modal-sidebar {
        border-left: none;
        border-top: 1px solid var(--border-light);
    }
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.section-header {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.section-header:first-of-type {
    padding-top: 0;
    border-top: none;
}

.metadata-table {
    margin-bottom: 24px;
}

.metadata-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.metadata-key {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.metadata-value {
    font-size: 0.85rem;
    color: var(--text-main);
    word-break: break-word;
}


/* Spinner for loading state */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(94, 92, 230, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.loading-card {
    opacity: 0.7;
}

.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 16px;
}

.loading-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Disabled button styling */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile Layout Optimizations */
@media (max-width: 640px) {
    .app-shell {
        padding-left: 0;
        padding-right: 0;
        padding-top: 20px;
    }

    .tool-container {
        padding: 0;
        max-width: 100% !important;
    }

    .card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 20px !important;
    }

    .gallery-grid {
        padding-left: 0;
        padding-right: 0;
        grid-template-columns: 1fr;
    }

    .guide-wrapper {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-top: 24px;
    }

    .hero-compact {
        margin-bottom: 4px !important;
        padding: 0;
    }

    .hero-compact h1 {
        font-size: 1.75rem;
        margin-bottom: 6px;
        padding: 0 16px;
    }

    .hero-compact p {
        font-size: 0.9rem;
        line-height: 1.4;
        padding: 0 16px;
    }
}