/* Modal Styles */
.modal {
    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;
}

.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-top: 0;
    color: var(--primary);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.modal-buttons button {
    min-width: 120px;
}

/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    background: var(--white);
    border-bottom: 2px solid var(--light);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-button {
    flex: 1;
    min-width: 120px;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-button:hover {
    background: var(--light);
    color: var(--primary);
}

.tab-button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--light);
    font-weight: 600;
}

.tab-button:focus {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* Mobile responsive tabs */
@media (max-width: 768px) {
    .tab-button {
        min-width: 100px;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}

/* Wizard Styles */
.wizard-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.wizard-progress {
    background: var(--white);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.progress-bar {
    height: 8px;
    background: var(--light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transition: width 0.5s ease;
    border-radius: 4px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.3s;
    cursor: pointer;
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 1;
}

.step.completed .step-number {
    background: var(--success);
    color: var(--white);
}

.step.active .step-number {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.1);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light);
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.step-label {
    font-size: 0.875rem;
    text-align: center;
    color: var(--dark);
}

/* Wizard Steps */
.wizard-step {
    display: none;
    animation: fadeIn 0.3s;
}

.wizard-step.active {
    display: block;
}

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

/* Navigation */
.wizard-navigation {
    position: sticky;
    bottom: 0;
    background: var(--white);
    padding: 1.5rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: var(--white);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s;
    z-index: 1000;
}

.side-menu.active {
    right: 0;
}

.menu-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-menu {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text);
}

.menu-nav {
    padding: 1rem 0;
}

.menu-nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.3s;
}

.menu-nav a:hover {
    background: var(--light);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* Summary Cards */
.summary-card,
.metrics-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--light);
    border-radius: 4px;
}

.summary-item label {
    font-weight: 600;
}

.summary-item.grand-total {
    background: #bbdefb;
    font-weight: 700;
}

/* Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.metric {
    text-align: center;
}

.metric-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.metric-label {
    color: var(--secondary);
    font-size: 0.875rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

/* Money Grid */
.money-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.drawer-section {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 8px;
}

.money-table {
    width: 100%;
    margin-top: 1rem;
}

.money-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.money-table input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: right;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .progress-steps {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .step-label {
        font-size: 0.75rem;
    }
    
    .money-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .button {
        width: 100%;
    }
}

/* Loading Spinner Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-spinner {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    text-align: center;
    min-width: 250px;
    max-width: 400px;
}

.spinner {
    display: block;
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 5px solid #ecf0f1;
    border-top: 5px solid #1565C0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-sizing: border-box;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}
