/* === Modal Base === */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-400);
    line-height: 1;
    z-index: 10;
}

.modal-close:hover {
    color: var(--gray-700);
}

/* === Welcome Modal === */
.modal-welcome {
    width: 700px;
    max-width: 90vw;
    text-align: center;
}

.modal-welcome h2 {
    font-size: 22px;
    margin-bottom: 24px;
    color: var(--gray-800);
}

.welcome-options {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.welcome-card {
    flex: 1;
    max-width: 200px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 24px 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.welcome-card:hover {
    border-color: var(--primary);
    background: rgba(56, 189, 248, 0.05);
    transform: translateY(-2px);
}

.welcome-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 12px;
}

.welcome-card h3 {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.4;
}

/* === Background Warning Modal === */
.modal-bg-warning {
    width: 600px;
    max-width: 90vw;
}

.modal-bg-warning h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

.bg-warning-message {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 16px;
    color: #1e40af;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.bg-warning-message i {
    margin-top: 2px;
    flex-shrink: 0;
}

#bg-warning-preview {
    text-align: center;
    margin-bottom: 16px;
    padding: 20px;
    background-image:
        linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
        linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-color: #f5f5f5;
    border-radius: 8px;
}

#bg-warning-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.bg-warning-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dont-show-again {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-500);
    cursor: pointer;
    margin-right: auto;
}

/* === Previous Designs Modal === */
#previous-designs-modal .modal-content {
    width: 600px;
    max-width: 90vw;
}

#previous-designs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.design-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s;
}

.design-card:hover {
    border-color: var(--primary);
}

.design-card-preview {
    height: 100px;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
}

.design-card-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.design-card-info {
    padding: 8px;
}

.design-card-info h4 {
    font-size: 12px;
    margin-bottom: 2px;
}

.design-card-info p {
    font-size: 11px;
    color: var(--gray-500);
}

/* === Upload Progress Modal === */
.upload-progress {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
}

.upload-progress.hidden {
    display: none;
}

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

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.2s;
    width: 0%;
}

.progress-text {
    font-size: 12px;
    color: var(--gray-600);
    white-space: nowrap;
}
