/**
 * Modal Component Styles
 * Consistent with application design
 */

/* Modal Overlay (from utils/modal.js) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-dialog {
    background: white;
    border-radius: 16px;
    max-width: 540px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    transform: scale(0.95) translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show .modal-dialog {
    transform: scale(1) translateY(0);
}

.modal-overlay .modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
}

.modal-overlay .modal-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.modal-overlay .modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
    flex: 1;
}

.modal-overlay .modal-body {
    padding: 28px;
    color: #374151;
    font-size: 15px;
    line-height: 1.6;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

.modal-info-box {
    background: linear-gradient(135deg, #f6f8fb 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}

.modal-info-box dl {
    margin: 0;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px 16px;
}

.modal-info-box dt {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.modal-info-box dd {
    margin: 0;
    color: #212529;
    font-weight: 500;
}

.modal-overlay .modal-footer {
    padding: 20px 28px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f9fafb;
}

.modal-overlay .btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-overlay .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.modal-overlay .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.modal-overlay .btn-secondary {
    background: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.modal-overlay .btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

/* Legacy modal-backdrop for backward compatibility */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-backdrop.active .modal-content {
    transform: translateY(0);
}

.modal-content.slide-in {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1a1a1a;
}

.btn-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f7fa;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #666;
}

.btn-close:hover {
    background: #e1e8ed;
    color: #1a1a1a;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid #e1e8ed;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Print Modal Specific */
.tariff-checkbox {
    padding: 1rem;
    background: #f5f7fa;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.tariff-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.tariff-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
}

.tariff-checkbox span {
    font-size: 0.95rem;
    color: #1a1a1a;
}

.print-options,
.print-options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.print-option,
.print-option-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.print-option:hover,
.print-option-card:hover {
    border-color: #2563eb;
    background: #f5f7fa;
    transform: translateX(4px);
}

.print-option .icon,
.print-option-card .print-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.print-option .text,
.print-option-card .print-text {
    flex: 1;
}

.print-option .text strong,
.print-option-card .print-text strong {
    display: block;
    font-size: 1rem;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.print-option .text small,
.print-option-card .print-text small {
    display: block;
    font-size: 0.875rem;
    color: #666;
}

/* Responsive */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem 1.5rem;
    }

    .print-option {
        padding: 1rem;
    }

    .print-option .icon {
        font-size: 1.5rem;
    }
}
