/* ================================
   Costs Page Styles
   ================================ */

/* Page Container */
.costs-page-container {
    background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-beige) 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

/* Page Header */
.costs-page-header {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.costs-page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-brown);
    margin: 0 0 0.5rem 0;
    font-family: 'Cairo', sans-serif;
}

.costs-page-header .subtitle {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin: 0;
}

/* Summary Cards */
.costs-summary-section {
    margin-bottom: 2rem;
}

.costs-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.costs-summary-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.costs-summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.costs-summary-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-green);
}

.costs-summary-card .card-label {
    font-size: 1rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.costs-summary-card .card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-brown);
}

/* Table Section */
.costs-table-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.costs-table-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-brown);
    margin-bottom: 1.5rem;
    font-family: 'Cairo', sans-serif;
}

.costs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 10px;
}

.costs-table thead {
    background: linear-gradient(135deg, var(--primary-green) 0%, #2d8659 100%);
}

.costs-table thead th {
    color: white;
    font-weight: 600;
    text-align: right;
    padding: 1.2rem 1rem;
    font-size: 1.05rem;
    border: none;
}

.costs-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s ease;
}

.costs-table tbody tr:hover {
    background-color: rgba(52, 128, 88, 0.05);
}

.costs-table tbody td {
    padding: 1rem;
    text-align: right;
    vertical-align: top;
    color: var(--text-dark);
}

.costs-table .building-name-cell {
    font-weight: 700;
    color: var(--primary-brown);
    font-size: 1.1rem;
}

.costs-table .cost-value-cell {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--primary-green);
}

.cost-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.cost-badge.category-high {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
    color: white;
}

.cost-badge.category-medium-high {
    background: linear-gradient(135deg, #ffc107 0%, #d39e00 100%);
    color: white;
}

.cost-badge.category-medium {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.cost-badge.category-low {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.percentage-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    background: var(--bg-beige);
    color: var(--primary-brown);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Development Items List */
.development-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.development-items-list li {
    padding: 0.4rem 0;
    border-bottom: 1px dashed #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.development-items-list li:last-child {
    border-bottom: none;
}

.item-name {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.item-quantity {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--primary-green);
    color: white;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Charts Section */
.costs-charts-section {
    margin-top: 2rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.chart-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-brown);
    margin-bottom: 1.5rem;
    text-align: center;
    font-family: 'Cairo', sans-serif;
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

/* Action Buttons */
.costs-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding: 2rem 0;
}

.costs-action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.costs-action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.costs-action-button i {
    font-size: 1.2rem;
}

.costs-action-button-primary {
    background: linear-gradient(135deg, var(--primary-green) 0%, #2d8659 100%);
    color: white;
    border: none;
}

.costs-action-button-primary:hover {
    background: linear-gradient(135deg, #2d8659 0%, var(--primary-green) 100%);
    color: white;
}

.costs-action-button-outline {
    background: white;
    color: var(--primary-brown);
    border: 2px solid var(--primary-brown);
}

.costs-action-button-outline:hover {
    background: var(--primary-brown);
    color: white;
}

/* Print Styles */
@media print {
    .costs-page-container {
        background: white;
        padding: 0;
    }

    .costs-actions,
    .navbar,
    footer {
        display: none !important;
    }

    .costs-table thead {
        background: #348058 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .cost-badge,
    .percentage-badge {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .costs-page-header,
    .costs-table-section,
    .chart-card {
        box-shadow: none !important;
        page-break-inside: avoid;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .costs-page-header h1 {
        font-size: 1.8rem;
    }

    .costs-summary-cards {
        grid-template-columns: 1fr;
    }

    .costs-table {
        font-size: 0.85rem;
    }

    .costs-table thead th,
    .costs-table tbody td {
        padding: 0.8rem 0.5rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-wrapper {
        height: 250px;
    }

    .costs-actions {
        flex-direction: column;
    }

    .costs-action-button {
        width: 100%;
        justify-content: center;
    }

    .costs-table-section {
        padding: 1rem;
        overflow-x: auto;
    }

    /* Make table scrollable on mobile */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.costs-page-header,
.costs-summary-card,
.costs-table-section,
.chart-card {
    animation: slideInUp 0.6s ease-out;
}

.costs-summary-card:nth-child(1) { animation-delay: 0.1s; }
.costs-summary-card:nth-child(2) { animation-delay: 0.2s; }
.costs-summary-card:nth-child(3) { animation-delay: 0.3s; }
.costs-summary-card:nth-child(4) { animation-delay: 0.4s; }
