/* Worksheets Page - Hands-On Exercise Tracker */

:root {
    --five9-blue: #0066CC;
    --five9-blue-dark: #0052A3;
    --five9-blue-light: #E6F2FF;
    --five9-teal: #00B4A6;
    --five9-teal-light: #E6F7F6;
    --gray-900: #1a1a1a;
    --gray-700: #4a4a4a;
    --gray-500: #6b6b6b;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --success: #22c55e;
    --success-light: #dcfce7;
    --success-dark: #16a34a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--five9-blue) 0%, var(--five9-blue-dark) 100%);
    padding: 1rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.back-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--white);
}

.header h1 {
    color: var(--white);
    font-size: 1.375rem;
    font-weight: 600;
}

/* Certification Note */
.cert-note {
    background: var(--five9-blue-light);
    border-bottom: 1px solid rgba(0, 102, 204, 0.2);
    padding: 0.875rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cert-note-icon {
    font-size: 1.25rem;
}

.cert-note p {
    font-size: 0.875rem;
    color: var(--five9-blue-dark);
    margin: 0;
}

.cert-note strong {
    font-weight: 600;
}

/* Control Bar (Progress + Filter) */
.control-bar {
    background: var(--white);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.control-bar-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Progress Section */
.progress-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    max-width: 400px;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.progress-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.progress-stats {
    font-size: 0.875rem;
    color: var(--five9-blue);
    font-weight: 600;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    min-width: 100px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--five9-blue), var(--five9-teal));
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
}

/* Filter Section */
.filter-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
}

.filter-dropdown {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    font-size: 0.9rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: var(--white);
    color: var(--gray-900);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b6b6b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    min-width: 280px;
}

.filter-dropdown:hover {
    border-color: var(--five9-blue);
}

.filter-dropdown:focus {
    outline: none;
    border-color: var(--five9-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

/* Main Content */
.main {
    flex: 1;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Pillar Section */
.pillar-section {
    margin-bottom: 3rem;
}

.pillar-section.hidden {
    display: none;
}

.pillar-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.pillar-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.pillar-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--five9-blue);
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.pillar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.pillar-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    padding-left: 3rem;
}

.pillar-progress {
    color: var(--five9-blue);
    font-weight: 500;
}

/* Worksheets Grid */
.worksheets-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Worksheet Card */
.worksheet-card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.worksheet-card:hover {
    border-color: var(--five9-blue);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
}

.worksheet-card.completed {
    border-color: var(--success);
    background: linear-gradient(to right, var(--success-light) 0%, var(--white) 50%);
}

.worksheet-card.highlighted {
    box-shadow: 0 0 0 3px var(--five9-blue);
}

/* Worksheet Header */
.worksheet-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    user-select: none;
}

.worksheet-checkbox {
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--white);
}

.checkbox-custom:hover {
    border-color: var(--five9-blue);
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--success);
    border-color: var(--success);
}

.checkbox-custom::after {
    content: '';
    width: 6px;
    height: 11px;
    border: solid var(--white);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s;
}

.checkbox-input:checked + .checkbox-custom::after {
    transform: rotate(45deg) scale(1);
}

.worksheet-info {
    flex: 1;
    min-width: 0;
}

.worksheet-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.375rem;
    line-height: 1.4;
}

.worksheet-card.completed .worksheet-title {
    color: var(--gray-700);
}

.worksheet-goal {
    font-size: 0.9375rem;
    color: var(--gray-600);
    line-height: 1.5;
}

.worksheet-toggle {
    flex-shrink: 0;
    color: var(--gray-400);
    font-size: 0.875rem;
    transition: transform 0.2s;
    padding: 0.25rem;
    width: 24px;
    text-align: center;
}

.worksheet-card.expanded .worksheet-toggle {
    transform: rotate(180deg);
}

/* Worksheet Content (Expandable) */
.worksheet-content {
    display: none;
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid var(--gray-100);
}

.worksheet-card.expanded .worksheet-content {
    display: block;
}

/* Steps */
.steps-section {
    padding-top: 1.25rem;
}

.steps-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.75px;
    margin-bottom: 1rem;
}

.step-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}

.step-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--five9-blue-light);
    color: var(--five9-blue);
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
}

.step-description {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.65;
}

/* Notes */
.notes-section {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: #FFFBEB;
    border-left: 4px solid #F59E0B;
    border-radius: 0 8px 8px 0;
}

.note-item {
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.6;
}

.note-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.notes-section.tip {
    background: #ECFDF5;
    border-left-color: var(--success);
}

.notes-section.important {
    background: #FEF2F2;
    border-left-color: #EF4444;
}

/* Task Reference */
.task-reference {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.task-reference a {
    color: var(--five9-blue);
    text-decoration: none;
    font-weight: 500;
}

.task-reference a:hover {
    text-decoration: underline;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 1.25rem 2rem;
    text-align: center;
    font-size: 0.875rem;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .control-bar {
        padding: 1rem;
    }

    .control-bar-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .progress-section {
        max-width: none;
    }

    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-dropdown {
        min-width: auto;
        width: 100%;
    }

    .main {
        padding: 1rem;
    }

    .worksheet-header {
        padding: 1rem;
    }

    .worksheet-content {
        padding: 0 1rem 1rem 1rem;
    }

    .pillar-meta {
        padding-left: 0;
    }
}
