/* ===================================
   TOTENBUREGNSKAP - UNIFIED STYLES
   =================================== */

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #0d47a1;
    color: white;
    min-height: 100vh;
}

/* Container Styles */
.container {
    width: 80%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header/Navigation */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.page-header h2 {
    margin: 0;
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Headings */
h2, h3 {
    color: white;
    margin-bottom: 15px;
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.3rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: white;
}

.left-align-label {
    text-align: left;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    color: #333;
    background-color: white;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 5px rgba(25, 118, 210, 0.5);
}

/* Buttons */
button[type="submit"],
button[type="button"],
.btn {
    padding: 12px 24px;
    background-color: #1976d2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
    margin: 5px;
}

button[type="submit"]:hover,
button[type="button"]:hover,
.btn:hover {
    background-color: #1565c0;
}

button[type="button"].secondary {
    background-color: #757575;
}

button[type="button"].secondary:hover {
    background-color: #616161;
}

a {
    text-decoration: none;
}

/* Login Page Specific */
body.login-page {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.login-container {
    width: 90%;
    max-width: 450px;
    margin: 100px auto 0;
    text-align: center;
    background-color: rgba(13, 71, 161, 0.85);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.login-container h2 {
    margin-bottom: 30px;
    font-size: 2rem;
}

.login-container .form-group {
    text-align: center;
}

.login-container input {
    max-width: 350px;
    margin: 0 auto;
}

.error-message {
    color: #ff5252;
    background-color: rgba(255, 82, 82, 0.1);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: bold;
}

/* Tables */
.tables-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.tables-container .top-frame {
    flex: 1;
}

.top-frame {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.balance-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.balance-table td {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.balance-table td:first-child {
    font-weight: bold;
    text-align: left;
}

.balance-table td:last-child {
    text-align: right;
}

/* Transaction Table */
.transaction-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.transaction-table th,
.transaction-table td {
    padding: 12px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
}

/* Wider columns for date and amount */
.transaction-table th:nth-child(1),
.transaction-table td:nth-child(1) {
    min-width: 100px;
    white-space: nowrap;
}

.transaction-table th:nth-child(2),
.transaction-table td:nth-child(2) {
    min-width: 110px;
    white-space: nowrap;
}

/* Wider columns for balance amounts */
.transaction-table th:nth-child(6),
.transaction-table th:nth-child(7),
.transaction-table th:nth-child(8),
.transaction-table th:nth-child(9),
.transaction-table td:nth-child(6),
.transaction-table td:nth-child(7),
.transaction-table td:nth-child(8),
.transaction-table td:nth-child(9) {
    min-width: 100px;
    white-space: nowrap;
}

/* Right-align numeric columns */
.transaction-table td:nth-child(2),
.transaction-table td:nth-child(6),
.transaction-table td:nth-child(7),
.transaction-table td:nth-child(8),
.transaction-table td:nth-child(9) {
    text-align: right;
}

.transaction-table th {
    background-color: rgba(0, 0, 0, 0.3);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.transaction-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Frames */
.middle-frame {
    color: white;
    margin-bottom: 20px;
}

.bottom-frame {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 10px;
}

/* Register Expense Button */
.register-expense {
    margin: 20px 0;
    text-align: center;
}

/* Error Page */
.error-container {
    text-align: center;
    margin-top: 100px;
    padding: 40px;
}

.error-container h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.error-container p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Tablet and Mobile */
@media screen and (max-width: 768px) {
    .container {
        width: 95%;
        padding: 15px;
    }

    .login-container {
        width: 95%;
        padding: 30px 20px;
        margin-top: 50px;
    }

    /* Stack tables vertically */
    .tables-container {
        flex-direction: column;
        gap: 15px;
    }

    .tables-container .top-frame {
        width: 100%;
    }

    /* Navigation */
    .page-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
    }

    .nav-links a {
        width: 100%;
    }

    /* Headings */
    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    /* Transaction table scroll */
    .bottom-frame {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .transaction-table {
        min-width: 800px;
        font-size: 14px;
    }

    .transaction-table th,
    .transaction-table td {
        padding: 8px 4px;
        font-size: 12px;
    }

    /* Balance table */
    .balance-table td {
        padding: 8px;
        font-size: 14px;
    }

    /* Buttons */
    button[type="submit"],
    button[type="button"],
    .btn {
        width: 100%;
        padding: 14px 20px;
    }

    .register-expense {
        margin: 15px 0;
    }
}

/* Small Mobile */
@media screen and (max-width: 480px) {
    .container {
        width: 98%;
        padding: 10px;
    }

    .login-container {
        width: 98%;
        padding: 25px 15px;
        margin-top: 30px;
    }

    .login-container h2 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1rem;
    }

    .balance-table td {
        padding: 6px;
        font-size: 13px;
    }

    .transaction-table {
        font-size: 12px;
    }

    .transaction-table th,
    .transaction-table td {
        padding: 6px 2px;
        font-size: 11px;
    }

    .top-frame {
        padding: 15px;
    }

    .bottom-frame {
        padding: 15px;
    }
}
