/* === Global Resets & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}
body {
    background-image: url(background.png);
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    min-height: 100vh;
}
.page-content-wrapper {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 90px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
a {
    text-decoration: none;
    color: white;
}
hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
    margin: 30px 0;
}
footer {
    text-align: center;
    margin-top: 40px;
}
footer small {
    font-size: 1rem;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px black, -1px -1px 2px black;
}

/* === Loading Screen === */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 29, 0.98);
    z-index: 10005;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
    opacity: 1;
}
#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loading-content {
    text-align: center;
    color: #f0f0f0;
}
.loading-content p {
    margin-top: 20px;
    font-size: 1.2rem;
}
.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid gray;
    border-top-color: #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === Navbar & Header === */
.navbar {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 10002;
}
.dropdown {
    position: relative;
    display: inline-block;
}
.logo-container {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: transparent;
    border: 2px solid white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}
.logo-container:hover {
    background-color: rgba(60, 60, 63, 0.9);
}
.logo-container img {
    max-width: 200%;
    max-height: 200%;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #2d2d30;
    border: 1px solid #444;
    border-radius: 6px;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    z-index: 1;
    top: 100%;
    left: 0;
    padding: 8px 0;
    margin-top: 5px;
}
.dropdown-content a {
    color: #f0f0f0;
    padding: 12px 20px;
    display: block;
}
.dropdown-content a:hover {
    background-color: white;
    color: black;
}
header {
    margin-bottom: 30px;
}
.header-logo {
    max-width: 300px;
    height: auto;
    border-radius: 3%;
}

/* === Content & Forms === */
.content-block {
    background-color: #2d2d30;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #333;
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
    color: white;
}
h1 {
    font-size: 2rem;
    margin-bottom: 25px;
    color: white;
}
h2 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}
h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-align: center;
}
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}
.form-group {
    text-align: center;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #555;
    background-color: #1a1a1d;
    color: #f0f0f0;
    font-size: 1rem;
}
.checkbox-group {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}
.checkbox-group:hover label {
    color: #4a90e2;
    cursor: pointer;
}
.checkbox-group input[type="checkbox"] {
    cursor: pointer;
    width: 20px;
    height: 20px;
    accent-color: #27ae60;
}
.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 10px;
}
.error-message {
    font-weight: bold;
    margin-top: 15px;
    display: none;
    color: #e74c3c;
}
.success-message {
    font-weight: bold;
    margin-top: 15px;
    display: none;
    color: #2ecc71;
}
#employee-select,
#manager-employee-select,
#login-employee-select {
    text-align: center;
    text-align-last: center;
}

/* === Buttons === */
button,
.action-button {
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background-color: rgba(26, 26, 29, 0.5);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}
button:hover,
.action-button:hover {
    background-color: #888;
    transform: translateY(-1px);
}
button:disabled {
    background-color: #555 !important;
    color: #888 !important;
    cursor: not-allowed;
    transform: none;
}
.clear-button {
    background-color: #c0392b;
}
.clear-button:hover {
    background-color: #e74c3c;
}
.clock-in-btn {
    background-color: #27ae60;
    color: white;
}
.clock-in-btn:hover {
    background-color: #2ecc71;
}
.clock-out-btn {
    background-color: #c0392b;
    color: white;
}
.clock-out-btn:hover {
    background-color: #e74c3c;
}

/* === Specific Components & Converted Inline Styles === */
#employee-login-container,
#manager-login-container,
#sop-login-container {
    max-width: 450px;
}

#employee-content,
#sop-content,
#manager-content,
.interiors-page-block { /* Generic class for interiors page */
    display: none;
    width: 100%;
}

#employee-content {
    max-width: 800px;
}

#manager-content {
    max-width: 1100px;
}

#sop-content {
    max-width: 1000px;
}

.interiors-page-block {
    max-width: 1200px;
}

#time-clock-interface {
    display: none;
}

#clock-out-btn {
    display: none;
}

#cancel-edit-btn {
    display: none;
}

#welcome-message {
    display: none;
    color: #f0f0f0;
    border-bottom: none;
    margin-bottom: 20px;
}

#commission-calculator-section {
    margin-top: 30px;
    background-color: transparent;
    border: none;
    padding: 0;
}

#export-logs-btn,
#export-transactions-btn {
    margin-bottom: 20px;
}

#password-status {
    display: none;
}

#sop-login-container p {
    margin-bottom: 20px;
}

.interiors-page-block h2 {
    margin-bottom: 20px;
}

.status-box {
    background-color: rgba(26, 26, 29, 0.7);
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    margin: 20px 0;
}
#time-clock-controls {
    margin-bottom: 15px;
}
.log-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #444;
    border-radius: 8px;
    background-color: rgba(26, 26, 29, 0.5);
    padding: 10px;
    text-align: left;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th,
td {
    padding: 10px;
    border-bottom: 1px solid #444;
}
th {
    background-color: #2d2d30;
    text-align: left;
}
tr:nth-child(even) {
    background-color: rgba(60, 60, 63, 0.3);
}
.employee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #444;
}
#employee-list .employee-item:last-child {
    border-bottom: none;
}
#employee-list .employee-details {
    text-align: left;
}

.employee-actions button {
    font-size: 0.8rem;
    padding: 5px 10px;
}

.employee-actions button + button {
    margin-left: 10px;
}

/* --- Collapsible Calculator --- */
.collapsible-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}
.collapsible-header h2 {
    border-bottom: none;
    margin-bottom: 0;
}
.collapsible-header button {
    font-size: 0.8rem;
    padding: 5px 10px;
}
#calculator-content-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding-top 0.5s ease-in-out, margin-top 0.5s ease-in-out;
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}
#calculator-content-wrapper.open {
    max-height: 1500px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #444;
}
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}
.calculator-box {
    background-color: rgba(26, 26, 29, 0.5);
    padding: 20px;
    border-radius: 8px;
}
.calculator-box h3 {
    text-align: center;
    margin-top: 0;
}
.calculator-box input[type="number"] {
    text-align: center;
    font-size: 1.1rem;
}
.result-display {
    margin-top: 15px;
    font-size: 1.2rem;
    text-align: center;
}
.result-display strong {
    color: #2ecc71;
    font-size: 1.4rem;
}
.calculator-actions {
    text-align: center;
}
@media (max-width: 768px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

/* --- SOP Page --- */
.pdf-container {
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

/* --- Interior Gallery Page --- */
#filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}
.filter-btn {
    background-color: #3a3a3d;
    color: #f0f0f0;
}
.filter-btn.active {
    background-color: #4a90e2;
    color: #fff;
}
.interior-category {
    margin-bottom: 40px;
}
.interior-category h2 {
    text-align: left;
    color: white;
    margin-bottom: 20px;
}
.interior-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}
.interior-item {
    background-color: #2d2d30;
    border: 1px solid #444;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 15px;
    transition: background-color 0.2s;
}
.interior-item:hover {
    background-color: #3a3a3d;
}
.interior-preview {
    flex-shrink: 0;
}
.preview-image {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #555;
}
.interior-details {
    flex-grow: 1;
    text-align: left;
    min-width: 0;
}
.interior-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #f0f0f0;
    white-space: nowrap;
}
.interior-note {
    display: block;
    font-size: 0.8rem;
    color: #aaa;
    font-style: italic;
}
.copy-link {
    background-color: #1a1a1d;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    border: 1px solid #555;
    transition: background-color 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}
.copy-link:hover {
    background-color: #4a90e2;
    color: white;
}
.copy-link input {
    position: absolute;
    top: -9999px;
    left: -9999px;
    opacity: 0;
}

/* --- Flyer Styles --- */
.flyer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.flyer-item {
    background-color: #2d2d30;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.flyer-preview {
    width: 100%;
    height: 250px;
    background-color: #1a1a1d;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    overflow: hidden;
    background-color: transparent;
}
.flyer-image {
    max-width: 100%;
    max-height: 100%;
    cursor: pointer;
}
.flyer-item h3 {
    text-align: center;
    margin: 0;
    color: #f0f0f0;
    font-size: 1.1rem;
}
.flyer-item .copy-link {
    width: 50%;
    margin: 0 auto;
}

/* --- Lightbox Styles --- */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10010;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
#lightbox-image {
    max-width: 90%;
    max-height: 90%;
    border: 3px solid #fff;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}
#lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    transition: color 0.2s;
}
#lightbox-close:hover {
    color: #ccc;
}
/* === Contact Us Page Styles === */

#contact-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.contact-card {
    background-color: #2d2d30;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    /* Added for the hover effect */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.contact-card:hover {
    transform: translateY(-5px); /* Lifts the card up slightly */
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.contact-card-left {
    flex-basis: 120px;
    flex-shrink: 0;
    text-align: center;
}
.contact-profile-pic {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #4a90e2;
    margin-bottom: 10px;
}
.contact-name {
    margin: 0;
    font-size: 1.2rem;
    border: none;
    padding: 0;
}
.contact-phone {
    font-size: 1rem;
    color: #ccc;
    margin-top: 5px;
}

.contact-card-right {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.contact-business-card {
    max-width: 250px;
    width: 100%;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
    cursor: pointer; /* Makes the card look clickable */
}

/* This targets the copy button on this page specifically */
.contact-card-right .copy-link {
    width: 75%;          /* Makes the button narrower */
    max-width: 200px;    /* Prevents it from getting too wide */
    margin: 0 auto;      /* Centers the button horizontally */
}

/* --- Manager Form Section Titles --- */

.form-section-title {
    text-align: left;
    margin-top: 20px;
    margin-bottom: 5px;
    font-size: 1.1rem;
    color: #4a90e2;
}

.form-note {
    text-align: left;
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 15px;
}

.calculator-flyer-container {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #444;
}

.calculator-flyer-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    margin: 0 auto;
}