/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    background-color: #f5f7fa;
    color: #333;
}

/* Container Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 95%;
}

/* Auth Section (Google Sign-In) */
#authSection {
    margin-bottom: 20px;
}
#google-signin, #logout-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    background-color: #4285f4;
    color: #fff;
    font-size: 1rem;
    margin: 0 5px;
    transition: background 0.2s;
}
#google-signin:hover, #logout-btn:hover {
    background-color: #3367d6;
}
#user-email {
    font-size: 1rem;
    color: #222;
    vertical-align: middle;
}

/* Header Styles */
.header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: #fff;
    color: #333;
}

input[type="date"], input[type="time"], input[type="number"] {
    min-width: 120px;
}

input:focus, select:focus {
    outline: 2px solid #3498db;
    border-color: #3498db;
}

/* Earnings Display */
.earnings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.earning-box, .earning-widget {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.earning-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2ecc71;
    margin: 0.5rem 0;
    display: block;
}

.divider {
    color: #bbb;
    margin: 0.5rem 0;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.rate-label {
    font-size: 0.95rem;
    color: #888;
    margin-right: 5px;
}

.rate-amount {
    font-size: 1.1rem;
    color: #e67e22;
    font-weight: 500;
}

.update-date {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.3rem;
}

.date-range {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 0.5rem;
}

/* Table Styles */
.history {
    margin-top: 2rem;
}
.scroll-container {
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tbody tr:hover {
    background-color: #f1f7ff;
}

/* Button Styles */
.btn-group {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

button, .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    margin-bottom: 0.5rem;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-secondary {
    background-color: #888;
    color: white;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-success {
    background-color: #2ecc71;
    color: white;
}

.btn-logout {
    background-color: #e67e22;
    color: #fff;
    margin-top: 1.5rem;
    float: right;
}

button:disabled, .btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        width: 90%;
    }
    .earnings-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    table {
        min-width: 600px;
    }
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 10px;
    }
    .earnings-container {
        grid-template-columns: 1fr;
    }
    .btn-group {
        flex-direction: column;
    }
    button, .btn {
        width: 100%;
    }
    .earning-box, .earning-widget {
        padding: 1rem;
    }
    .scroll-container {
        margin: 1rem 0;
    }
    table {
        min-width: 400px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 100%;
        padding: 10px;
    }
    input, select {
        padding: 0.5rem;
    }
    .earning-amount {
        font-size: 1.25rem;
    }
    th, td {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    table {
        min-width: 300px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #fff;
    }
    .header, .earning-box, .earning-widget, .scroll-container {
        background-color: #2d2d2d;
    }
    input, select {
        background-color: #333;
        color: #fff;
        border-color: #444;
    }
    th {
        background-color: #333;
    }
    td {
        border-bottom-color: #444;
    }
    .btn-primary, .btn-success, .btn-danger, .btn-secondary, .btn-logout {
        color: #fff;
    }
}

/* Print Styles */
@media print {
    .btn-group, .form-group, .btn-logout, #authSection {
        display: none !important;
    }
    .scroll-container {
        box-shadow: none;
    }
    body {
        background: white;
        color: #000;
    }
    .container {
        width: 100%;
        max-width: none;
    }
}