/* ===================================
   Private View Styles
   =================================== */

/* Ensure private view is empty until authenticated */
#view-private:empty {
    background: var(--card-bg);
}

.private-container {
    display: flex;
    height: 100%;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.private-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    padding: 16px;
}

/* Header */
.private-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.private-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Tabs Row */
.private-tabs-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 12px;
}

.private-tabs {
    display: flex;
    gap: 4px;
}

.private-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.private-tab:hover {
    color: var(--text-primary);
    background: var(--glass-panel);
}

.private-tab.active {
    color: var(--text-primary);
    background: var(--glass-panel-hover);
}

/* Content Area */
.private-content {
    flex: 1;
    overflow-y: auto;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--card-border);
}

/* Empty State */
.private-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-secondary);
}

.private-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.private-empty p {
    font-size: 14px;
}

/* ===================================
   Income Header Controls
   =================================== */

.income-header-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.income-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.income-add-btn:hover {
    filter: brightness(1.1);
}

.income-add-btn i {
    font-size: 16px;
}

/* ===================================
   Income Analysis Grid
   =================================== */

.income-analysis-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    padding: 0;
}

/* First row: 2 columns (3 grid columns each) */
.income-chart-card:nth-child(1),
.income-chart-card:nth-child(2) {
    grid-column: span 3;
}

/* Second row onwards: 3 columns (2 grid columns each) */
.income-chart-card:nth-child(n+3) {
    grid-column: span 2;
}

.income-chart-card {
    background: var(--glass-panel);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-card-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chart-card-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chart-card-header p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.chart-card-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.chart-card-body canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Empty State */
.income-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.income-empty-state i {
    font-size: 64px;
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 20px;
}

.income-empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.income-empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Responsive: Mobile (700px and below) */
@media screen and (max-width: 700px) {
    .income-analysis-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .income-chart-card:nth-child(1),
    .income-chart-card:nth-child(2),
    .income-chart-card:nth-child(n+3) {
        grid-column: span 1;
    }

    .income-chart-card {
        padding: 12px;
    }

    .chart-card-header h4 {
        font-size: 13px;
    }

    .chart-card-header p {
        font-size: 11px;
    }

    .chart-card-body {
        min-height: 240px;
    }
}

/* ===================================
   Income Entry Modal
   =================================== */

.income-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.income-modal {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    animation: scaleIn 0.3s forwards;
}

.income-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--card-border);
}

.income-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.income-month-nav {
    background: var(--glass-panel);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.income-month-nav:hover {
    background: var(--glass-panel-hover);
    border-color: var(--accent-blue);
}

.income-month-nav i {
    font-size: 20px;
}

.income-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.income-form-section {
    margin-bottom: 20px;
}

.income-form-section:last-child {
    margin-bottom: 0;
}

.income-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--card-border);
}

.income-form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.income-form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.income-form-field label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.income-form-field input {
    width: 100%;
    padding: 6px 10px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

.income-form-field input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: var(--input-bg-hover);
}

.income-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--card-border);
}

.income-modal-actions {
    display: flex;
    gap: 12px;
}

.income-modal-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.income-modal-btn-prev-data {
    background: var(--glass-panel);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.income-modal-btn-prev-data:hover:not(:disabled) {
    background: var(--glass-panel-hover);
    border-color: var(--accent-blue);
}

.income-modal-btn-prev-data i {
    font-size: 16px;
}

.income-modal-btn-cancel {
    background: var(--glass-panel);
    color: var(--text-secondary);
}

.income-modal-btn-cancel:hover {
    background: var(--glass-panel-hover);
    color: var(--text-primary);
}

.income-modal-btn-save {
    background: var(--accent-blue);
    color: white;
}

.income-modal-btn-save:hover {
    filter: brightness(1.1);
}

/* Tablet */
@media screen and (max-width: 1000px) {
    .income-form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small Tablet */
@media screen and (max-width: 800px) {
    .income-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media screen and (max-width: 700px) {
    .income-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .income-modal-header {
        padding: 16px;
    }

    .income-modal-title {
        font-size: 16px;
    }

    .income-month-nav {
        width: 32px;
        height: 32px;
    }

    .income-modal-body {
        padding: 16px;
    }

    .income-modal-footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
    }

    .income-modal-actions {
        width: 100%;
    }

    .income-modal-btn {
        flex: 1;
    }

    .income-modal-btn-prev-data {
        width: 100%;
    }
}

@media screen and (max-width: 500px) {
    .income-form-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   Responsive Layout - Private
   =================================== */

/* Mobile/Small Tablet (700px and below) */
@media screen and (max-width: 700px) {
    .private-main {
        padding: 12px;
    }

    .private-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .private-tab {
        font-size: 12px;
        padding: 5px 10px;
    }

    .private-content {
        padding: 10px;
    }
}

/* Mobile (400px and below) */
@media screen and (max-width: 400px) {
    .private-main {
        padding: 8px;
    }

    .private-title {
        font-size: 16px;
    }

    .private-tabs-row {
        margin-bottom: 8px;
    }

    .private-tab {
        font-size: 11px;
        padding: 4px 8px;
    }
}
