/* static/css/modal.css */

/* General Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal-overlay.visible {
    display: flex;
    opacity: 1;
}

/* Core Modal Structure */
.modal {
    background-color: var(--white, #fff);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 520px;
    font-family: var(--main-font-family);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease-in-out;
}

.modal-overlay.visible .modal {
    transform: scale(1);
}

/* Modal Header */
.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e6e6e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark, #212529);
    margin: 0;
    letter-spacing: -0.01em;
}

.close-modal {
    font-size: 1.75rem;
    color: var(--text-muted, #6c757d);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.close-modal:hover {
    opacity: 1;
}

/* Modal Body */
.modal-body {
    padding: 32px;
    line-height: 1.6;
    color: var(--text-medium);
}

.modal-body p {
    margin-top: 0;
    margin-bottom: 1rem;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

/* Modal Footer */
.modal-footer {
    padding: 24px 32px;
    background-color: var(--background-light, #f8f9fa);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e6e6e6;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Form elements inside modals */
.modal .form-group {
    margin-bottom: 1.5rem;
}

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

.modal .form-group input,
.modal .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modal .form-group input:focus,
.modal .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.25);
}

.modal .read-only-input {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.modal .text-danger {
    color: var(--danger-color, #dc3545);
    font-size: 0.875em;
    margin-top: 0.5rem;
}

/* ===============================================
   SUBSCRIPTION MODAL SPECIFIC STYLES
   =============================================== */

/* Billing Summary Section */
.billing-summary {
    background-color: var(--background-light-shade, #f8f9fa);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.billing-summary h4 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark, #212529);
}

.billing-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.billing-line span:first-child {
    color: var(--text-dark, #212529);
}

.billing-line span:last-child {
    font-weight: 500;
    color: var(--text-dark, #212529);
}

.billing-total {
    border-top: 1px solid #e0e0e0;
    margin-top: 16px;
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.billing-total span:first-child {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark, #212529);
}

.billing-total span:last-child {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-dark, #1e40af);
}

.credit-amount {
    color: var(--success-green, #059669) !important;
}

/* Enterprise Details Section */
.enterprise-details {
    background-color: var(--background-light-shade, #f8f9fa);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.enterprise-details h4 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark, #212529);
}

.detail-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.detail-line:last-child {
    margin-bottom: 0;
}

.detail-line span:first-child {
    color: var(--text-muted, #6c757d);
    font-size: 0.95rem;
}

.detail-line span:last-child {
    color: var(--text-dark, #212529);
    font-weight: 500;
    font-size: 0.95rem;
}

/* User Count Controls */
.user-count-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
}

.count-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid #e0e0e0;
    background: var(--white, #fff);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark, #212529);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.count-btn:hover {
    border-color: var(--primary-color, #0066cc);
    background-color: var(--primary-color, #0066cc);
    color: white;
}

.count-btn:active {
    transform: scale(0.95);
}

.user-count-controls input[type="number"] {
    width: 80px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 12px 8px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: var(--white, #fff);
    font-family: var(--main-font-family);
}

.user-count-controls input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color, #0066cc);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Price Display */
.price-display {
    text-align: center;
    margin-top: 16px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-dark, #1e40af);
    padding: 8px 12px;
    background-color: rgba(30, 64, 175, 0.1);
    border-radius: 6px;
}

/* Modal Footer Adjustments for Subscription Modals */
.modal-footer .btn {
    padding: 12px 20px;
    font-size: 0.95rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.modal-footer .btn-primary {
    background-color: var(--primary-color, #0066cc);
    color: white;
}

.modal-footer .btn-primary:hover {
    background-color: var(--primary-dark, #0052a3);
    transform: translateY(-1px);
}

.modal-footer .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.modal-footer .btn-secondary:hover {
    background-color: #565e64;
}

.modal-footer .btn-danger {
    background-color: var(--danger-color, #dc3545);
    color: white;
}

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

/* Responsive Design for Subscription Modals */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-width: none;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .billing-summary,
    .enterprise-details {
        padding: 16px;
    }
    
    .billing-line,
    .detail-line {
        font-size: 0.9rem;
    }
    
    .user-count-controls {
        gap: 12px;
    }
    
    .count-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .user-count-controls input[type="number"] {
        width: 70px;
        font-size: 1.1rem;
        padding: 10px 6px;
    }
    
    .price-display {
        font-size: 1rem;
    }
}
