@import 'variables.css';

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

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
}

/* Layout */
#app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: var(--space-md);
    overflow-y: auto;
    flex-shrink: 0;
}

.brand {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand span {
    color: var(--accent-primary);
}

.icon-btn.active {
    color: var(--accent-primary);
}

/* PROSTACK Upsell Banner */
.prostack-banner {
    margin: 1.5rem 1rem 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(255, 92, 0, 0.05) 0%, rgba(255, 92, 0, 0.1) 100%);
    border: 1px solid rgba(255, 92, 0, 0.2);
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.prostack-banner:hover {
    background: linear-gradient(135deg, rgba(255, 92, 0, 0.08) 0%, rgba(255, 92, 0, 0.15) 100%);
    border-color: rgba(255, 92, 0, 0.3);
}

.prostack-banner a:hover {
    background: var(--accent-secondary) !important;
    transform: translateY(-1px);
}

/* Scrollbar Styling */
.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.nav-item {
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-item:hover {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-left: 3px solid var(--accent-primary);
}

.nav-item .status-icon {
    font-size: 0.8rem;
    opacity: 0.5;
}

.nav-item.completed .status-icon {
    color: var(--success);
    opacity: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
    max-width: 1000px;
    margin: 0 auto;
}

.phase-header {
    margin-bottom: var(--space-lg);
    animation: fade-in 0.5s ease-out;
}

.phase-eyebrow {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.phase-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--space-sm);
}

.phase-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
}

/* Cards & Steps */
.step-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    transition: transform 0.2s ease, border-color 0.2s ease;
    animation: slide-up 0.5s ease-out forwards;
    opacity: 0;
}

.step-card:hover {
    border-color: var(--border-focus);
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.step-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.step-content {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.step-content ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.step-content li {
    margin-bottom: 0.25rem;
}

/* Interactive Elements */
.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
    cursor: pointer;
    transition: background-color 0.2s;
}

.checklist-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checklist-item.checked .checkbox {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checklist-item.checked .checkbox::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checklist-item.checked span {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Inputs */
.input-group {
    margin-bottom: var(--space-md);
}

.input-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.text-input {
    width: 100%;
    background-color: var(--bg-body);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    transition: border-color 0.2s;
}

.text-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Progress Bar */
.progress-container {
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.progress-bar-bg {
    height: 6px;
    background-color: var(--bg-card-hover);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--accent-primary);
    width: 0%;
    transition: width 0.5s ease;
}

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utilities */
.btn {
    background-color: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Hide mobile elements on desktop */
.mobile-header {
    display: none;
}

.mobile-overlay {
    display: none;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        overflow: auto;
    }

    #app {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    /* Sidebar - Hidden by default on mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.mobile-open {
        left: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }

    /* Mobile Header */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: var(--space-md);
        background-color: var(--bg-sidebar);
        border-bottom: 1px solid var(--border-subtle);
        position: sticky;
        top: 0;
        z-index: 999;
    }

    .mobile-menu-btn {
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-brand {
        font-family: var(--font-heading);
        font-size: 1.5rem;
        font-weight: 800;
        letter-spacing: -0.02em;
    }

    .mobile-brand span {
        color: var(--accent-primary);
    }

    /* Overlay */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.7);
        z-index: 999;
    }

    .mobile-overlay.active {
        display: block;
    }

    /* Main Content */
    .main-content {
        padding: var(--space-lg);
        max-width: 100%;
        overflow-y: visible;
        height: auto;
    }

    /* Phase Header */
    .phase-title {
        font-size: 2rem;
    }

    .phase-description {
        font-size: 1rem;
    }

    /* Step Cards */
    .step-card {
        padding: var(--space-md);
        margin-bottom: var(--space-md);
    }

    .step-title {
        font-size: 1.25rem;
    }

    /* Checklist Items */
    .checklist-item {
        padding: var(--space-sm);
        font-size: 0.95rem;
    }

    /* Input Groups */
    .input-group {
        margin-bottom: var(--space-md);
    }

    .text-input {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    /* Buttons */
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        width: 100%;
    }

    .btn-outline {
        padding: 0.875rem 1.5rem;
    }

    /* Progress Bar in Sidebar */
    .progress-container {
        padding: var(--space-md);
    }

    /* Hide desktop-only elements */
    .sidebar-footer {
        padding: var(--space-md) !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .main-content {
        padding: var(--space-md);
    }

    .phase-title {
        font-size: 1.75rem;
    }

    .step-title {
        font-size: 1.125rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--space-md);
    }

    .stat-number {
        font-size: 2rem;
    }
}

@media print {
    body {
        height: auto;
        overflow: visible;
        background-color: white;
        color: black;
    }

    #app {
        display: block;
        height: auto;
        width: auto;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        max-width: 100%;
        padding: 0;
        margin: 0;
        overflow: visible;
    }

    .step-card {
        border: 1px solid #ccc;
        break-inside: avoid;
        box-shadow: none;
        margin-bottom: 2rem;
        color: black;
        background: white;
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .step-title {
        color: black;
    }

    .step-content {
        color: #333;
    }

    .checklist-item {
        background-color: transparent;
        border: 1px solid #eee;
        color: black;
    }

    .checklist-item.checked span {
        color: #666;
    }

    .text-input {
        border: 1px solid #ccc;
        background: white;
        color: black;
    }

    .btn,
    .btn-outline {
        display: none;
    }

    .phase-header {
        color: black;
        animation: none !important;
    }

    .phase-title,
    .phase-description {
        color: black;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}