:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #64748b;
    --background: #f8fafc;
    --surface: #ffffff;
    --glass: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: #f3f4f6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #c7d2fe 100%);
    z-index: -1;
}

.app-container {
    width: 100%;
    max-width: 800px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.25rem;
}

/* Steps General */
.step-content {
    animation: fadeIn 0.4s ease-out;
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Inputs & Forms */
.input-group {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

input[type="text"] {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    transition: all 0.2s;
    outline: none;
    font-family: inherit;
    text-align: center;
    letter-spacing: 0.05em;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s, box-shadow 0.2s;
    display: inline-block;
    margin-top: 1.5rem;
    width: 100%;
    max-width: 400px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Breadcrumbs / Back Navigation */
.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
}

.btn-back {
    background: none;
    border: none;
    color: var(--secondary);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.btn-back:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.step-indicator {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 500;
    background: #f1f5f9;
    padding: 0.35rem 1rem;
    border-radius: 99px;
}

/* Cards (NBS, IndOp) */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem;
}

.selection-card {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.selection-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
    background: #eef2ff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    align-self: flex-start;
}

.card-title {
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.4;
}

/* Step 3 Grouping */
.indop-section {
    margin-bottom: 2rem;
    background: #f8fafc;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.indop-header {
    background: #f1f5f9;
    padding: 1rem;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 1px solid #e2e8f0;
}

.class-list {
    padding: 1rem;
}

.class-item {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #eff6ff;
}

.class-item:hover {
    border-color: var(--primary);
    background: #dbeafe;
}

.class-code {
    font-family: monospace;
    font-weight: 700;
    color: var(--primary);
    min-width: 90px;
    margin-right: 1.25rem;
    font-size: 1.3rem;
}

.class-name {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-main);
}

/* Summary Box */
.summary-box {
    background: #1e293b;
    color: white;
    padding: 2rem;
    border-radius: var(--radius);
    margin-top: 1rem;
}

.summary-row {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 500;
}

.copy-btn {
    background: white;
    color: var(--text-main);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: #f1f5f9;
}

/* Utility */
.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.text-error {
    color: #ef4444;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    min-height: 1.25rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Ads & Footer */
.ad-container {
    width: 100%;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.ad-placeholder {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.app-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.app-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.app-footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}