/* General Body & Layout */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f6f8;
    margin: 0;
    color: #333;
    min-height: 100vh;
    position: relative;
}

.app-body {
    display: flex;
    justify-content: center;
    padding-top: 100px;
    background-color: transparent;
}

body.app-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('https://peakbaggerblobs.blob.core.windows.net/pbphoto/p21135L.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.15;
}

body.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
    background-size: cover;
    background-position: center;
}

body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
}

.container {
    width: 100%;
    max-width: 900px;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1;
    margin: 20px;
}

.login-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.login-box {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    color: #1877f2;
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
}

.welcome-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #e8f0fe;
    padding: 12px 20px;
    font-size: 16px;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.top-right-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-icon {
    font-size: 28px;
    color: #3c4043;
    cursor: pointer;
    transition: color 0.3s;
}

.profile-icon:hover {
    color: #1a73e8;
}

#welcome-message {
    font-weight: 500;
    color: #3c4043;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

h1 {
    text-align: center;
    color: #202124;
    margin-bottom: 30px;
}

.container > h1 {
    position: relative;
    z-index: 1;
    padding: 20px 0;
}

.container > h1::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 100%;
    background-image: url('floral-background.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.2;
    z-index: -1;
}

#timesheet-form, #edit-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.totals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background-color: #fafafa;
}

legend {
    font-weight: 600;
    color: #1a73e8;
    padding: 0 10px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 500;
    color: #5f6368;
    font-size: 14px;
}

input[type="date"], input[type="number"], input[type="text"], input[type="email"], input[type="password"], input[type="tel"], select {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
    background-color: #fff;
    -webkit-appearance: none;
    appearance: none;
}

input:focus, select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s, box-shadow 0.3s;
    text-align: center;
    background-color: #1877f2;
    color: white;
}

.button:hover {
    background-color: #166fe5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.table-container {
    width: 100%;
    margin-top: 40px;
    overflow-x: auto;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #1a73e8;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.table-header h2 {
    color: #202124;
    margin: 0;
}

#timesheet-table {
    width: 100%;
    border-collapse: collapse;
}

#timesheet-table th, #timesheet-table td {
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
}

#timesheet-table thead {
    background-color: #f2f2f2;
}

#timesheet-table th {
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.edit-btn, .delete-btn, .share-week-btn, .show-week-btn {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: #f8f9fa;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.edit-btn:hover { background-color: #e2e6ea; }

.delete-btn { background-color: #f8d7da; border-color: #f5c6cb; color: #721c24; }

.delete-btn:hover { background-color: #f1b0b7; }

.share-week-btn { background-color: #d1ecf1; border-color: #bee5eb; color: #0c5460; }

.share-week-btn:hover { background-color: #b8daff; }

.show-week-btn { background-color: #d1ecf1; border-color: #bee5eb; color: #0c5460; }

.show-week-btn:hover { background-color: #b8daff; }

.week-summary-row {
    background-color: #e8f0fe;
    font-weight: bold;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 95%;
    max-width: 600px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
}

#profile-modal .modal-content {
    max-width: 450px;
    padding: 0;
}

.modal-header {
    background-color: #1a73e8;
    color: white;
    padding: 15px 20px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

#profile-info {
    padding: 20px;
}

#profile-info p {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    font-size: 16px;
}

#profile-info i {
    color: #1a73e8;
    font-size: 20px;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

#edit-form .button { width: 100%; background-color: #28a745; }

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

#week-details-content {
    margin-top: 20px;
}

.week-details-entry {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
}

.week-details-total {
    text-align: right;
    font-weight: bold;
    font-size: 1.1em;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #1a73e8;
}

@media (max-width: 768px) {
    .app-body {
        padding-top: 80px;
    }

    .container {
        margin: 0;
        padding: 15px;
        border-radius: 0;
        box-shadow: none;
    }
    
    .welcome-container {
        padding: 10px 15px;
    }

    #welcome-message {
        font-size: 14px;
    }

    #logout-button {
        padding: 6px 12px;
        font-size: 14px;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .form-grid,
    .totals-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    fieldset {
        padding: 15px;
    }

    #timesheet-table thead {
        display: none;
    }

    #timesheet-table, #timesheet-table tbody, #timesheet-table tr, #timesheet-table td {
        display: block;
        width: 100%;
    }

    #timesheet-table tr {
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 15px;
        background-color: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    #timesheet-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }

    #timesheet-table td:last-child {
        border-bottom: none;
    }

    #timesheet-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #333;
    }

    .action-buttons {
        justify-content: flex-end;
    }

    .week-summary-row {
        padding: 15px;
        text-align: right;
    }

    .week-summary-row td {
        justify-content: flex-end;
        padding: 0;
    }
    
    .modal-content {
        width: 90%;
        padding: 20px;
        max-height: 90vh;
    }

    .close-button {
        top: 8px;
        right: 15px;
    }
}

#error-message, #message.error {
    color: red;
}

.success-message {
    color: green;
}

.phone-input-container {
    display: flex;
    align-items: center;
}

#country-code {
    margin-right: 10px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    background-color: #fff;
}

@keyframes spinner-border {
  to { transform: rotate(360deg); }
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    vertical-align: -0.125em;
    border: .25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: .75s linear infinite spinner-border;
}

#login-button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#login-button.button-loading .spinner {
    display: inline-block;
}

/* Tab Navigation Styles */
.tabs {
    display: flex;
    border-bottom: 2px solid #ccc;
    margin-bottom: 20px;
}

.tab-link {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1.1em;
    font-weight: 500;
    color: #555;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-link.active {
    color: #1a73e8; /* Adjusted color to match theme */
    border-bottom-color: #1a73e8;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Scoped styles for the account page */
.account-form .form-group {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 15px;
    align-items: center;
}

.account-form .form-group label {
    text-align: right;
}

.button-danger {
    background-color: #d93025;
}

.button-danger:hover {
    background-color: #c0271d;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 40px; /* Make space for the icon */
}

.toggle-password {
    position: absolute;
    right: 10px;
    cursor: pointer;
    color: #888;
}
