/* /app/static/significantstories_com/css/modals.css */
/* Shared modal/dialog styles used across the site */

/* ============================================
   Base Modal Overlay
   Usage: Add .modal-overlay to the container element
   Use 'hidden' attribute to hide, or .active class to show
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

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

.modal-overlay[hidden] {
    display: none;
}

/* When modal-overlay doesn't have hidden attribute and isn't explicitly hidden */
.modal-overlay:not([hidden]):not(.active) {
    display: none;
}

/* ============================================
   Modal Dialog Box
   Usage: Add .modal-dialog to the inner content box
   ============================================ */
.modal-dialog {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Smaller variant for simple confirmations */
.modal-dialog.modal-dialog-sm {
    max-width: 360px;
}

/* Larger variant for complex dialogs */
.modal-dialog.modal-dialog-lg {
    max-width: 500px;
}

/* ============================================
   Modal Typography
   ============================================ */
.modal-title {
    font-family: var(--serif-font, Georgia, serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.75rem 0;
}

.modal-message {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
}

.modal-hint {
    font-size: 0.85rem;
    color: #888;
    margin: 0 0 1.25rem 0;
    line-height: 1.4;
}

.modal-dialog p {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-dialog ul {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
    text-align: left;
}

.modal-dialog li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* ============================================
   Modal Actions (Button Container)
   ============================================ */
.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.modal-actions button,
.modal-actions .modal-btn {
    flex: 1;
    min-width: 100px;
}

/* ============================================
   Modal Buttons
   ============================================ */
.modal-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

/* Secondary/Cancel button */
.modal-btn-secondary,
.modal-btn-cancel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
}

.modal-btn-secondary:hover,
.modal-btn-cancel:hover {
    background: #e9ecef;
}

/* Primary button */
.modal-btn-primary {
    background: #3498db;
    border: 1px solid #3498db;
    color: #fff;
}

.modal-btn-primary:hover {
    background: #2980b9;
}

/* Danger/Destructive button */
.modal-btn-danger {
    background: #dc3545;
    border: 1px solid #dc3545;
    color: #fff;
}

.modal-btn-danger:hover {
    background: #c82333;
}

.modal-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ============================================
   Modal Links
   ============================================ */
.modal-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.modal-link:hover {
    text-decoration: underline;
}

/* ============================================
   Modal Form Elements
   ============================================ */
.modal-form-group {
    margin: 1rem 0;
    text-align: left;
}

.modal-form-label {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.modal-textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

.modal-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.modal-char-count {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
    text-align: right;
}

/* ============================================
   Modal Privacy Box (for auth-related modals)
   ============================================ */
.modal-privacy-box {
    margin: 1rem 0;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.modal-privacy-box ul {
    margin: 0;
    padding-left: 1.25rem;
    text-align: left;
}

.modal-privacy-box li {
    margin-bottom: 0.375rem;
}

.modal-privacy-box li:last-child {
    margin-bottom: 0;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 600px) {
    .modal-dialog {
        padding: 1.25rem;
        margin: 0.5rem;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions button,
    .modal-actions .modal-btn {
        width: 100%;
    }
}
