/* /home/code/cellstoredev/gymgemini/public_html/assets/css/style.css */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.app-authenticated {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100vh;
    overflow: hidden;
}

.topbar {
    background-color: #fff;
    padding: 1rem 2rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.topbar h1 {
    margin: 0;
    font-size: 1.5rem;
}

.topbar h1 a {
    text-decoration: none;
    color: #333;
}

.topbar-actions {
    display: flex;
    align-items: center;
}

.account-menu {
    position: relative;
}

.account-menu summary {
    list-style: none;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border: 1px solid #d7dde4;
    border-radius: 999px;
    background: #fff;
    color: #223247;
    font-weight: 600;
}

.account-menu summary::-webkit-details-marker {
    display: none;
}

.account-menu[open] summary {
    border-color: #aebdcb;
    box-shadow: 0 8px 20px rgba(16, 32, 51, 0.08);
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 180px;
    padding: 0.5rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #d7dde4;
    box-shadow: 0 16px 30px rgba(16, 32, 51, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 20;
}

.account-dropdown a {
    color: #223247;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
}

.account-dropdown a:hover {
    background: #eef4f8;
    text-decoration: none;
}

.app-shell {
    display: flex;
    flex: 1;
    min-height: 0;
}

.app-authenticated .app-shell {
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background: #102033;
    color: #dbe5f0;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
}

.app-authenticated .sidebar {
    overflow: hidden;
}

.sidebar-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-nav a {
    text-decoration: none;
    color: #dbe5f0;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    display: block;
    padding: 0.8rem 1rem;
    border-radius: 12px;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    text-decoration: none;
}

.sidebar-nav a.is-active {
    background: #fff;
    color: #102033;
    box-shadow: 0 10px 24px rgba(0,0,0,0.14);
}

.app-main {
    flex-grow: 1;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.app-authenticated .app-main {
    min-height: 0;
    overflow-y: auto;
}

.app-main-guest {
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

footer {
    text-align: center;
    padding: 1.5rem;
    background-color: #fff;
    border-top: 1px solid #ddd;
    font-size: 0.9rem;
    color: #777;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tbody tr:hover {
    background-color: #f1f1f1;
}

/* Form Styles */
form {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1rem;
}

.form-group.has-error input,
.form-group.has-error select {
    border-color: #d64545;
    background: #fff9f9;
}

.field-hint {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: #6a7784;
}

.field-error {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: #b12626;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.settings-form {
    max-width: 760px;
}

.notice {
    max-width: 760px;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
}

.notice-success {
    background: #edf8f0;
    border-color: #b7dfc1;
    color: #1f6b35;
}

.notice-error {
    background: #fff1f0;
    border-color: #f2c4c0;
    color: #9b2c23;
}

/* Button and Link Styles */
button, .button-add {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    text-decoration: none;
    display: inline-block;
}

button:hover, .button-add:hover {
    background-color: #0056b3;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Details View Styles */
.details-container {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    max-width: 800px;
    margin-bottom: 2rem;
}

.details-group {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.7;
}

.details-group strong {
    display: inline-block;
    width: 150px;
    color: #555;
}

.settings-card {
    max-width: 760px;
}

.status-active {
    color: #28a745;
    font-weight: bold;
}

.status-inactive, .status-expired {
    color: #dc3545;
    font-weight: bold;
}

td a {
    margin-right: 0.5rem;
}

td a:last-child {
    margin-right: 0;
}

a.delete-link {
    color: #dc3545;
}

a.delete-link:hover {
    color: #a71d2a;
}

/* Login Page Styles */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.signup-container {
    max-width: 520px;
}

.error-message,
.success-message {
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 6px;
    font-size: 0.95rem;
}

.error-message {
    background: #fff1f0;
    border: 1px solid #f2c4c0;
    color: #9b2c23;
}

.success-message {
    background: #edf8f0;
    border: 1px solid #b7dfc1;
    color: #1f6b35;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Check-in Page Styles */
.checkin-container {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    max-width: 700px;
    margin-bottom: 2rem;
}

#search-results {
    position: relative;
}

.search-results-list {
    position: absolute;
    width: 100%;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    list-style: none;
    margin: -10px 0 0 0;
    padding: 0;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
}

.search-results-list li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-results-list li:hover {
    background-color: #f0f0f0;
}

@media (max-width: 900px) {
    body.app-authenticated {
        display: flex;
        height: auto;
        overflow: visible;
    }

    .topbar {
        padding: 1rem 1.25rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .app-shell {
        flex-direction: column;
    }

    .app-authenticated .app-shell {
        overflow: visible;
    }

    .sidebar {
        width: 100%;
        padding: 1rem;
        overflow: visible;
    }

    .sidebar-nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .sidebar-nav li {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 130px;
    }

    .sidebar-nav a {
        padding: 0.75rem 0.9rem;
    }

    .app-main {
        padding: 1.25rem;
    }

    .app-authenticated .app-main {
        min-height: auto;
        overflow: visible;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    form,
    .details-container,
    .checkin-container,
    .login-container {
        padding: 1.25rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .sidebar-nav li {
        flex-basis: 100%;
        min-width: 0;
    }

    .topbar h1 {
        font-size: 1.25rem;
    }

    .account-menu summary {
        width: 100%;
        text-align: center;
    }
}

.search-results-list li .member-status {
    font-weight: bold;
    font-size: 0.9em;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    color: #fff;
}

.member-status.status-active { background-color: #28a745; }
.member-status.status-inactive { background-color: #6c757d; }
.member-status.status-expired { background-color: #dc3545; }

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card h3 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #555;
}

.card p {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
    color: #007bff;
    text-align: right;
}

.card.full-width {
    grid-column: 1 / -1;
}

.card table {
    margin-top: 0;
    box-shadow: none;
}
