/* ============================================================
   NATHAN'S OFFICE — CLIENT DASHBOARD
   Design system matching new website brand identity
   ============================================================ */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Variables ── */
:root {
    --bg-primary: #0B0B0B;
    --bg-secondary: #141414;
    --bg-tertiary: #1A1A1A;
    --accent-gold: #D4A937;
    --accent-gold-dim: rgba(212, 169, 55, 0.3);
    --text-heading: #FFFFFF;
    --text-body: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-dark-heading: #2A2A2A;
    --text-dark-body: #555555;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-gold: rgba(212, 169, 55, 0.4);
    --success: #4CAF50;
    --error: #E53935;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
    --transition: 0.3s ease;
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--text-body);
    background-color: var(--bg-primary);
    line-height: 1.7;
    min-height: 100vh;
}

/* ── Grain Overlay (matches website) ── */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ── Typography ── */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--text-heading);
}

h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-style: italic;
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    font-style: italic;
    line-height: 1.3;
}

h3 {
    font-size: 1.1rem;
    font-family: var(--font-body);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-gold);
}

p {
    font-size: clamp(0.95rem, 1.2vw, 1.05rem);
    line-height: 1.7;
    color: var(--text-body);
}

a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: #E8C04A;
}

/* ── Labels ── */
.label {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    color: var(--text-muted);
}

/* ── Layout ── */
.page-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Navigation Bar ── */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 3rem;
}

.navbar-logo img {
    height: 56px;
    opacity: 0.9;
    transition: opacity var(--transition);
}

.navbar-logo img:hover {
    opacity: 1;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.navbar-user {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn-logout {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border-subtle);
    padding: 0.5rem 1.2rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-logout:hover {
    color: var(--text-heading);
    border-color: var(--text-muted);
}


/* ── Login Page ── */
.login-container {
    max-width: 420px;
    margin: 0 auto;
    padding-top: 15vh;
    width: 100%;
}

.login-logo {
    text-align: center;
    margin-bottom: 3rem;
}

.login-logo img {
    height: 80px;
    opacity: 0.9;
}

.login-title {
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.9rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--text-heading);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    outline: none;
    transition: border-color var(--transition);
}

.form-group input:focus {
    border-color: var(--accent-gold);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--bg-primary);
    background: var(--accent-gold);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background: #E8C04A;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.form-footer a {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-footer a:hover {
    color: var(--accent-gold);
}

/* ── Alert Messages ── */
.alert {
    padding: 0.9rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    border-left: 3px solid;
    display: none;
}

.alert.show {
    display: block;
}

.alert-error {
    background: rgba(229, 57, 53, 0.1);
    border-color: var(--error);
    color: #EF5350;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border-color: var(--success);
    color: #66BB6A;
}

/* ── Dashboard Cards ── */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-style: italic;
    color: var(--text-heading);
}

.card-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    padding: 0.3rem 0.8rem;
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
}

/* ── Progress Tracker ── */
.progress-tracker {
    padding: 0.5rem 0;
}

.progress-step {
    display: flex;
    align-items: flex-start;
    padding: 0.8rem 0;
    position: relative;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 9px;
    top: 2.2rem;
    bottom: -0.2rem;
    width: 1px;
    background: var(--border-subtle);
}

.progress-step.completed:not(:last-child)::after {
    background: var(--accent-gold);
}

.progress-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-subtle);
    margin-right: 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.progress-step.completed .progress-dot {
    border-color: var(--accent-gold);
    background: var(--accent-gold);
}

.progress-step.completed .progress-dot::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid var(--bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.progress-step.active .progress-dot {
    border-color: var(--text-heading);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.progress-step.active .progress-dot::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-heading);
}

.progress-label {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-body);
}

.progress-step.completed .progress-label {
    color: var(--accent-gold);
}

.progress-step.active .progress-label {
    color: var(--text-heading);
    font-weight: 500;
}

.progress-step.pending .progress-label {
    color: var(--text-muted);
}

.progress-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ── Status Update Card ── */
.status-update {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-gold);
    padding: 1.2rem 1.5rem;
    margin-top: 1.5rem;
}

.status-update p {
    font-style: italic;
    font-size: 0.95rem;
    color: var(--text-body);
}

.status-update .status-time {
    font-style: normal;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ── Sprint Meta ── */
.sprint-meta {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.sprint-meta-item .label {
    display: block;
    margin-bottom: 0.3rem;
}

.sprint-meta-item .value {
    font-size: 1.1rem;
    color: var(--text-heading);
    font-weight: 400;
}

/* ── Upload Zone ── */
.upload-zone {
    border: 2px dashed var(--border-gold);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 1.5rem;
}

.upload-zone:hover,
.upload-zone.dragover {
    background: rgba(212, 169, 55, 0.05);
    border-color: var(--accent-gold);
}

.upload-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.upload-zone-text {
    font-size: 0.95rem;
    color: var(--text-body);
    margin-bottom: 0.5rem;
}

.upload-zone-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.upload-zone input[type="file"] {
    display: none;
}

/* ── File List ── */
.file-list {
    list-style: none;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

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

.file-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.file-icon {
    font-size: 1.2rem;
    opacity: 0.6;
}

.file-name {
    font-size: 0.9rem;
    color: var(--text-body);
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-status {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.file-status.uploading {
    color: var(--accent-gold);
    animation: pulse-upload 1.2s ease-in-out infinite;
}

@keyframes pulse-upload {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.file-status.complete {
    color: var(--success);
}

.file-status.error {
    color: var(--error);
}

/* ── Upload Progress Bar ── */
.upload-progress {
    width: 100%;
    height: 3px;
    background: var(--border-subtle);
    margin-top: 0.5rem;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: var(--accent-gold);
    width: 0%;
    transition: width 0.3s ease;
}

/* ── Thank You Message ── */
.thank-you-message {
    background: var(--bg-secondary);
    border: 1px solid var(--border-gold);
    padding: 2rem;
    text-align: center;
    display: none;
}

.thank-you-message.show {
    display: block;
}

.thank-you-message h2 {
    color: var(--accent-gold);
    margin-bottom: 1rem;
}

.thank-you-message p {
    font-size: 0.95rem;
    line-height: 1.8;
    max-width: 500px;
    margin: 0 auto;
}

/* ── Past Engagements ── */
.engagement-list {
    list-style: none;
}

.engagement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition);
}

.engagement-item:hover {
    background: var(--bg-tertiary);
}

.engagement-name {
    font-size: 0.95rem;
    color: var(--text-body);
}

.engagement-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.engagement-status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0.25rem 0.6rem;
}

.engagement-status.active {
    color: var(--accent-gold);
    background: var(--accent-gold-dim);
}

.engagement-status.completed {
    color: var(--success);
    background: rgba(76, 175, 80, 0.1);
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ── Footer ── */
.dashboard-footer {
    margin-top: auto;
    padding: 2rem 0;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.dashboard-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Welcome Section ── */
.welcome-section {
    margin-bottom: 2.5rem;
}

.welcome-section h1 {
    margin-bottom: 0.5rem;
}

.welcome-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Progress Detail (expanded phase info) ── */
.progress-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    line-height: 1.5;
    max-width: 350px;
}

/* ── Deliverable Downloads ── */
.deliverable-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.deliverable-section h3 {
    margin-bottom: 1rem;
}

.deliverable-links {
    display: flex;
    gap: 1rem;
}

.deliverable-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.2rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-gold);
    color: var(--accent-gold);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
}

.deliverable-link:hover {
    background: rgba(212, 169, 55, 0.1);
    border-color: var(--accent-gold);
}

.deliverable-icon {
    font-size: 1.2rem;
}

/* ── Returning Client Badge ── */
.returning-badge {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64B5F6;
    background: rgba(100, 181, 246, 0.15);
    padding: 0.1rem 0.4rem;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* ── Loading Skeleton ── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 2px;
}

@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    width: 80%;
}

.skeleton-text-short {
    height: 1rem;
    width: 40%;
    margin-bottom: 0.5rem;
}

.skeleton-card {
    height: 120px;
    margin-bottom: 1rem;
}

/* ── Admin Table Improvements ── */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--text-muted);
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.admin-table td {
    font-size: 0.85rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-body);
}

.admin-table tr:hover td {
    background: var(--bg-tertiary);
}

/* ── Status Pills ── */
.status-pill {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.2rem 0.6rem;
    display: inline-block;
}

.status-pill.awaiting {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
}

.status-pill.received {
    color: var(--accent-gold);
    background: var(--accent-gold-dim);
}

.status-pill.progress {
    color: #64B5F6;
    background: rgba(100, 181, 246, 0.15);
}

.status-pill.review {
    color: #CE93D8;
    background: rgba(206, 147, 216, 0.15);
}

.status-pill.complete {
    color: var(--success);
    background: rgba(76, 175, 80, 0.1);
}

/* ── Admin Action Buttons ── */
.btn-small {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-gold);
    background: none;
    border: 1px solid var(--border-gold);
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-small:hover {
    background: rgba(212, 169, 55, 0.1);
}

/* ── Modals ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    padding: 2rem;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

/* ── Responsive — Mobile First ── */
@media (max-width: 768px) {
    .page-wrapper {
        padding: 0 1.2rem;
    }

    .navbar {
        margin-bottom: 2rem;
    }

    .card {
        padding: 1.5rem;
    }

    .sprint-meta {
        flex-direction: column;
        gap: 1rem;
    }

    .upload-zone {
        padding: 2rem 1.5rem;
    }

    .login-container {
        padding-top: 10vh;
    }

    .deliverable-links {
        flex-direction: column;
    }

    /* Admin table responsive */
    .admin-table thead { display: none; }
    .admin-table tr {
        display: block;
        margin-bottom: 1rem;
        padding: 1rem;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-subtle);
    }
    .admin-table td {
        display: flex;
        justify-content: space-between;
        padding: 0.4rem 0;
        border: none;
        font-size: 0.85rem;
    }
    .admin-table td::before {
        content: attr(data-label);
        font-size: 0.65rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.2em;
        color: var(--text-muted);
        align-self: center;
    }
    .actions-cell {
        justify-content: flex-end !important;
    }

    .modal {
        width: 95%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .page-wrapper {
        padding: 0 1rem;
    }

    .card {
        padding: 1.2rem;
    }

    .navbar-user {
        display: none;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.2rem;
    }
}
