/* Focus Area Version 2 CSS
   Theme: black, white, silver
   Updated for Friend Feature
*/

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #000000;
    color: #ffffff;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font-family: Arial, Helvetica, sans-serif;
}

.app-shell {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px;
    background: #000000;
}

.home-header {
    text-align: center;
    padding: 24px 0 16px;
    background: #000000;
}

.logo {
    width: 220px;
    max-width: 82%;
    height: auto;
    display: block;
    margin: 0 auto;
    background: #000000;
}

.daily-card,
.card {
    background: #050505;
    border: 1px solid #2f2f2f;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.04);
}

.daily-card.completed {
    border-color: #555555;
    opacity: 0.85;
}

.small-label {
    margin: 0 0 6px;
    color: #c0c0c0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

h1, h2, h3, p {
    margin-top: 0;
}

h1 {
    font-size: 22px;
}

h2 {
    font-size: 20px;
    line-height: 1.3;
}

h3 {
    font-size: 18px;
}

.muted {
    color: #c9c9c9;
}

.hint {
    color: #b9b9b9;
    font-size: 14px;
}

.menu-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 24px 18px;
    background: #ffffff;
    color: #000000;
    border: 2px solid #c0c0c0;
    border-radius: 18px;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 1px;
    transition: 0.2s;
}

.main-button small {
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.main-button:active {
    transform: scale(0.98);
    background: #c0c0c0;
}

/* Pending Daily FA Submission highlight - Blue */
.pending-daily-button {
    border: 2px solid #8fd3ff;
    box-shadow: 0 0 16px rgba(143, 211, 255, 0.65);
    background: #ffffff;
}

.pending-submission-text {
    display: inline-block;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: #005b8f;
    background: #dff4ff;
    padding: 5px 10px;
    border-radius: 999px;
    margin-top: 2px;
}

/* Add FA First highlight - Orange */
.pending-fa-button {
    border: 2px solid #ffb347;
    box-shadow: 0 0 16px rgba(255, 179, 71, 0.75);
    background: #ffffff;
}

.pending-fa-text {
    display: inline-block;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: #8a3c00;
    background: #fff0d8;
    padding: 5px 10px;
    border-radius: 999px;
    margin-top: 2px;
}

/* Create Graph First highlight - Green */
.pending-graph-button {
    border: 2px solid #70ff9a;
    box-shadow: 0 0 16px rgba(112, 255, 154, 0.7);
    background: #ffffff;
}

.pending-graph-text {
    display: inline-block;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: #065b1f;
    background: #ddffe8;
    padding: 5px 10px;
    border-radius: 999px;
    margin-top: 2px;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.top-bar h1 {
    margin: 0;
}

/* Home top bar with Edit Username, Friends, Logout */
.home-top-bar {
    justify-content: space-between;
    align-items: flex-start;
}

.home-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

/* Navigation buttons: Home, Back, Friends, Logout */
.back-link {
    display: inline-block;
    background: #ffffff;
    color: #000000;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid #c0c0c0;
    white-space: nowrap;
    line-height: 1;
    cursor: pointer;
}

.back-link:active {
    transform: scale(0.96);
    background: #c0c0c0;
}

/* Friend request notification badge */
.friend-notification-link {
    position: relative;
    padding-right: 22px;
}

.friend-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ff3b3b;
    color: #ffffff;
    border: 2px solid #000000;
    font-size: 12px;
    font-weight: bold;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 8px rgba(255, 59, 59, 0.8);
}

/* Kept only so older backup admin/permission pages do not break */
.permission-button {
    appearance: none;
    -webkit-appearance: none;
}

.center-card {
    text-align: center;
    margin-top: 40px;
}

.date-box {
    display: inline-block;
    border: 1px solid #c0c0c0;
    padding: 10px 18px;
    border-radius: 10px;
    color: #ffffff;
    background: #050505;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 14px;
    padding: 13px 18px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
}

.btn-primary {
    background: #ffffff;
    color: #000000;
}

.btn-secondary {
    background: #c0c0c0;
    color: #000000;
}

.btn-outline {
    background: transparent;
    color: #ffffff;
    border: 1px solid #c0c0c0;
}

.btn-success {
    background: #ffffff;
    color: #000000;
    border: 1px solid #8dff9f;
}

.btn-danger {
    background: #401010;
    color: #ffd0d0;
    border: 1px solid #ff9b9b;
}

.btn-small {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 999px;
}

.btn:active {
    transform: scale(0.97);
}

.large-btn {
    width: 100%;
    font-size: 18px;
}

.full-width {
    width: 100%;
    margin-top: 14px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form label {
    color: #c0c0c0;
    font-size: 14px;
}

.form input,
.form select,
.form textarea {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    border: 1px solid #c0c0c0;
    background: #050505;
    color: #ffffff;
    font-size: 16px;
}

/* New large FA description box */
.description-box {
    width: 100%;
    min-height: 180px;
    padding: 13px;
    border-radius: 12px;
    border: 1px solid #c0c0c0;
    background: #050505;
    color: #ffffff;
    font-size: 16px;
    resize: vertical;
    line-height: 1.5;
}

.description-box::placeholder,
.form input::placeholder,
.search-box input::placeholder {
    color: #8f8f8f;
}

.error-box {
    background: #401010;
    border: 1px solid #ff9b9b;
    color: #ffd0d0;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.alert {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.alert-success {
    background: #103818;
    border: 1px solid #8dff9f;
    color: #caffd2;
}

.alert-error {
    background: #401010;
    border: 1px solid #ff9b9b;
    color: #ffd0d0;
}

.alert-info {
    background: #1e1e1e;
    border: 1px solid #777777;
    color: #ffffff;
}

.fa-list {
    margin-top: 16px;
}

.fa-row {
    border-bottom: 1px solid #333333;
    padding: 14px 0;
}

.fa-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fa-number {
    color: #c0c0c0;
    min-width: 44px;
    font-weight: bold;
}

.fa-title {
    flex: 1;
    font-size: 16px;
}

.fa-description {
    color: #d6d6d6;
    line-height: 1.5;
    margin-top: 8px;
}

.dots-btn {
    background: #050505;
    color: #ffffff;
    border: 1px solid #c0c0c0;
    border-radius: 999px;
    width: 34px;
    height: 26px;
    cursor: pointer;
    font-weight: bold;
}

.fa-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-left: 44px;
}

.mini-btn {
    border: 1px solid #c0c0c0;
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 13px;
    background: #050505;
    color: #ffffff;
    cursor: pointer;
}

.mini-btn.danger {
    border-color: #ff9b9b;
    color: #ffbdbd;
}

.fa-check-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 430px;
    overflow-y: auto;
    padding-right: 4px;
}

.fa-check-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px;
    border: 1px solid #333333;
    border-radius: 12px;
    background: #050505;
}

.fa-check-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 10;
}

.modal-overlay.hidden {
    display: none;
}

.modal-box {
    background: #050505;
    border: 1px solid #c0c0c0;
    color: #ffffff;
    border-radius: 18px;
    width: 100%;
    max-width: 360px;
    padding: 20px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 26px;
    cursor: pointer;
}

/* Kept for old admin permission backup pages */
.permission-modal-box h2 {
    margin-bottom: 10px;
}

.permission-status {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
}

.permission-status.enabled {
    background: #103818;
    border: 1px solid #8dff9f;
    color: #caffd2;
}

.permission-status.disabled {
    background: #2a2a2a;
    border: 1px solid #777777;
    color: #ffffff;
}

/* New modal description display */
.modal-description {
    white-space: pre-line;
    line-height: 1.5;
    color: #ffffff;
    margin-top: 12px;
    padding-right: 4px;
    max-height: 360px;
    overflow-y: auto;
}

.chart-container {
    width: 100%;
    height: 380px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #333333;
    padding: 12px;
    border-radius: 12px;
    background: #050505;
}

.history-item p {
    margin-bottom: 0;
}

.percentage-badge {
    background: #ffffff;
    color: #000000;
    padding: 8px 10px;
    border-radius: 999px;
    font-weight: bold;
}

.not-completed-group {
    border-top: 1px solid #333333;
    padding-top: 12px;
    margin-top: 12px;
}

.not-completed-group ul {
    margin-bottom: 0;
    padding-left: 20px;
}

/* ===============================
   GRAPH RECORD LIST PAGE
================================ */

.graph-record-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.graph-record-card {
    display: block;
    padding: 14px;
    border: 1px solid #333333;
    border-radius: 14px;
    background: #050505;
    transition: 0.2s;
}

.graph-record-card:active {
    transform: scale(0.98);
    background: #111111;
}

.graph-record-click-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.graph-record-left h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.graph-record-left p {
    margin: 0 0 4px;
}

.graph-record-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.week-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
}

.week-status.complete {
    background: #ffffff;
    color: #000000;
}

.week-status.progress {
    background: #c0c0c0;
    color: #000000;
}

.graph-manage-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #222222;
}

.graph-manage-actions .mini-btn {
    flex: 1;
    text-align: center;
}

.graph-manage-actions .mini-btn.danger {
    width: 100%;
    text-align: center;
}

/* Graph detail top bar */
.detail-top-bar {
    justify-content: space-between;
}

.detail-top-bar h1 {
    margin: 0;
    flex: 1;
    text-align: center;
}

.home-link {
    text-align: right;
}

/* ===============================
   FRIEND FEATURE PAGES
================================ */

.friend-container,
.page-container,
.menu-container {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px;
    background: #000000;
    color: #ffffff;
}

.friend-card,
.page-card,
.menu-card {
    background: #050505;
    border: 1px solid #2f2f2f;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.04);
}

.friend-card h1,
.page-card h1,
.menu-card h1 {
    margin-bottom: 10px;
}

.friend-card h2,
.page-card h2,
.menu-card h2 {
    margin-bottom: 12px;
}

.friend-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid #333333;
    padding: 14px 0;
}

.friend-row:last-child {
    border-bottom: none;
}

.friend-row strong {
    color: #ffffff;
    word-break: break-word;
}

.friend-row small {
    color: #c0c0c0;
}

.friend-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.friend-actions form {
    margin: 0;
}

.search-box {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.search-box input {
    flex: 1;
    min-width: 180px;
    padding: 13px;
    border-radius: 12px;
    border: 1px solid #c0c0c0;
    background: #050505;
    color: #ffffff;
    font-size: 16px;
}

.search-box button {
    white-space: nowrap;
}

.menu-card {
    text-align: center;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 24px;
}

.menu-buttons form {
    margin: 0;
}

.fa-item {
    border-bottom: 1px solid #333333;
    padding: 14px 0;
}

.fa-item:last-child {
    border-bottom: none;
}

.week-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid #333333;
    padding: 14px 0;
}

.week-row:last-child {
    border-bottom: none;
}

.week-title {
    font-size: 18px;
    font-weight: bold;
}

.week-meta {
    margin-top: 6px;
    color: #c0c0c0;
    font-size: 14px;
    line-height: 1.4;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 15px;
}

.summary-box {
    background: #050505;
    border: 1px solid #333333;
    padding: 14px;
    border-radius: 12px;
}

.summary-box strong {
    color: #c0c0c0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
    color: #ffffff;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid #333333;
    text-align: left;
    vertical-align: top;
}

th {
    background: #111111;
    color: #c0c0c0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    color: #ffffff;
}

/* Graph SVG wrapper from friend_view_graph_detail.php */
svg {
    max-width: 100%;
}

/* ===============================
   OLD ADMIN VIEW PAGES
   Kept for backup only
================================ */

.admin-user-card,
.friend-user-card {
    display: block;
    padding: 14px;
    border: 1px solid #333333;
    border-radius: 14px;
    background: #050505;
    margin-bottom: 12px;
}

.admin-user-card h3,
.friend-user-card h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.admin-user-card p,
.friend-user-card p {
    margin: 0 0 4px;
}

.admin-view-actions,
.friend-view-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.admin-view-actions .mini-btn,
.friend-view-actions .mini-btn {
    flex: 1;
    text-align: center;
}

/* ===============================
   MOBILE RESPONSIVE
================================ */

/* Mobile-first already, but this helps very small phones */
@media (max-width: 360px) {
    .app-shell,
    .friend-container,
    .page-container,
    .menu-container {
        padding: 12px;
    }

    .main-button {
        font-size: 19px;
        padding: 20px 14px;
    }

    .pending-submission-text,
    .pending-fa-text,
    .pending-graph-text {
        font-size: 12px;
        padding: 4px 9px;
    }

    .logo {
        width: 185px;
    }

    .back-link {
        font-size: 12px;
        padding: 6px 9px;
    }

    .home-actions {
        gap: 5px;
    }

    .top-bar {
        gap: 8px;
    }

    .detail-top-bar h1 {
        font-size: 19px;
    }

    .permission-status {
        font-size: 13px;
    }

    .friend-actions {
        width: 100%;
    }

    .friend-actions .btn,
    .friend-actions button,
    .friend-actions form {
        width: 100%;
    }

    .search-box input,
    .search-box button {
        width: 100%;
    }

    .week-row .btn {
        width: 100%;
    }

    th, td {
        padding: 9px;
        font-size: 13px;
    }
}

@media (min-width: 600px) {
    .friend-container,
    .page-container,
    .menu-container {
        max-width: 760px;
    }

    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}