/* ================= BODY & CONTAINER ================= */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f4f4f4;
}

.container {
    max-width: 1200px;  /* full desktop width */
    width: 95%;
    margin: 30px auto;
    padding: 20px;
    background: #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    border-radius: 10px;
}

/* ================= HEADER ================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e90ff;
    color: #fff;
    padding: 15px 30px;
    flex-wrap: wrap;
}

header h1 {
    font-size: 26px;
    margin: 0;
}

header .logout-btn {
    padding: 12px 24px;
    font-size: 16px;
    background: #ff4d4d;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

header .logout-btn:hover {
    background: #cc0000;
}

/* ================= FORM ================= */
form input, form button {
    display: block;
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    font-size: 16px;
}

form button {
    background: #1e90ff;
    color: #fff;
    border: none;
    cursor: pointer;
}

form button:hover {
    background: #0b63c5;
}

/* ================= BUTTONS ================= */
.btn {
    padding: 14px 24px;
    font-size: 16px;
    background: #1e90ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn:hover {
    background: #0b63c5;
}

/* ================= FILTERS ================= */
.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.filters .date-range {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ================= EXPENSE TABLE ================= */
.expenses-table {
    width: 100%;
    margin-top: 20px;
    overflow-x: auto;
}

.expenses-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 18px;
    min-width: 800px; /* wide table for desktop */
}

.expenses-table th, .expenses-table td {
    border: 1px solid #fff;
    padding: 14px 16px;
    text-align: center;
    background-color: #222;
    color: #fff;
}

.expenses-table th {
    background: #444;
    font-size: 18px;
    font-weight: bold;
}

.expenses-table tr:nth-child(even) {
    background-color: #333;
}

.expenses-table tr:hover {
    background-color: #555;
}

/* ================= ACTION BUTTONS ================= */
.action-btn {
    padding: 8px 14px;
    margin: 0 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
}

.edit-btn { background-color: #ffa500; }
.delete-btn { background-color: #ff4d4d; }

.edit-btn:hover { background-color: #e69500; }
.delete-btn:hover { background-color: #cc0000; }

/* ================= TOTAL AMOUNT ================= */
#totalAmount {
    font-weight: bold;
    color: #1e90ff;
    font-size: 22px;
    margin-top: 12px;
}

/* ================= AD OVERLAY ================= */
#adOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.ad-content {
    position: relative;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 700px;
    width: 90%;
}

.ad-content img, .ad-content video {
    max-width: 100%;
    border-radius: 10px;
}

#adOverlay button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4d4d;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-weight: bold;
    cursor: not-allowed;
    opacity: 0.5;
}

#adOverlay button.active {
    cursor: pointer;
    opacity: 1;
}

#adOverlay p {
    margin-top: 10px;
    font-size: 16px;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1200px) {
    .container {
        width: 95%;
        padding: 20px;
    }

    .expenses-table table {
        min-width: 700px;
    }
}

@media (max-width: 992px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters input, .filters button,
    #expenseForm input, #expenseForm button {
        width: 100%;
        margin-bottom: 8px;
    }

    .expenses-table table {
        font-size: 16px;
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 20px;
    }

    .btn, #expenseForm button {
        padding: 12px 18px;
        font-size: 16px;
    }

    #totalAmount {
        font-size: 20px;
    }

    .expenses-table th, .expenses-table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 18px;
    }

    .filters input, .filters button,
    #expenseForm input, #expenseForm button {
        font-size: 14px;
        padding: 8px;
    }

    #totalAmount {
        font-size: 18px;
    }

    .expenses-table th, .expenses-table td {
        padding: 8px;
    }
}
