/* =========================================
   Design Preview Generator - Styles
   ========================================= */

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

/* Auth Gate */
.auth-gate {
    position: fixed;
    inset: 0;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-gate.hidden {
    display: none;
}

.auth-gate__card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 40px 32px;
    text-align: center;
    max-width: 360px;
    width: 100%;
}

.auth-gate__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 8px;
}

.auth-gate__prompt {
    color: #666;
    margin-bottom: 24px;
    font-size: 0.9375rem;
}

.auth-gate__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-gate__input {
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.auth-gate__input:focus {
    border-color: #4a90d9;
}

.auth-gate__submit {
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.auth-gate__submit:hover {
    background: #357abd;
}

.auth-gate__error {
    color: #c0392b;
    font-size: 0.875rem;
    min-height: 1.25em;
    margin-top: 8px;
}

.app-content.hidden {
    display: none;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #222;
}

/* Type Selector */
.type-selector {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
}

.type-selector__btn {
    padding: 10px 32px;
    border: 2px solid #4a90d9;
    background: #fff;
    color: #4a90d9;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.type-selector__btn:first-child {
    border-radius: 8px 0 0 8px;
}

.type-selector__btn:last-child {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.type-selector__btn--active {
    background: #4a90d9;
    color: #fff;
}

.type-selector__btn:focus-visible {
    outline: 2px solid #4a90d9;
    outline-offset: 2px;
}

/* Upload Section */
.upload-section {
    margin-bottom: 24px;
}

/* Drop Zone */
.drop-zone {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 60px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.drop-zone:hover {
    border-color: #999;
}

.drop-zone.drag-over {
    border-color: #4a90d9;
    background-color: rgba(74, 144, 217, 0.05);
}

.drop-zone__prompt {
    font-size: 1rem;
    color: #888;
    pointer-events: none;
}

.drop-zone__input {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
}

/* Status Text */
.status {
    text-align: center;
    color: #666;
    font-size: 0.875rem;
    min-height: 1.5em;
}

/* Preview Section */
.preview-section {
    display: none;
    margin-top: 32px;
}

.preview-section.visible {
    display: block;
}

/* Preview Toolbar */
.preview-toolbar {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.btn-bulk-download {
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-bulk-download:hover {
    background: #357abd;
}

.btn-reset {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-reset:hover {
    background: #c0392b;
}

/* Preview Grid */
.preview-grid {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Preview Card */
.preview-card {
    flex: 1 1 0;
    min-width: 0;
    max-width: 300px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.preview-card__img {
    width: 100%;
    height: auto;
    display: block;
}

.preview-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
}

.preview-card__label {
    display: inline;
    padding: 0;
    font-weight: 600;
    font-size: 0.875rem;
    color: #444;
}

.preview-card__copy {
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.preview-card__copy:hover {
    background: #357abd;
}

.preview-card__copy--success {
    background: #27ae60;
}

.preview-card__copy--success:hover {
    background: #27ae60;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-left-color: #4a90d9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .preview-grid {
        flex-wrap: wrap;
    }

    .preview-card {
        flex: 0 0 calc(50% - 8px);
        max-width: none;
    }

    .container {
        padding: 24px 16px;
    }
}

/* Accessibility: Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .drop-zone {
        transition: none;
    }

    .spinner {
        animation: none;
    }

    .preview-card__copy {
        transition: none;
    }

    .type-selector__btn {
        transition: none;
    }

    .btn-bulk-download {
        transition: none;
    }

    .btn-reset {
        transition: none;
    }
}
