/**
 * Limud Step Survey - Premium Clean Design
 * Minimal, elegant, and cohesive design system
 */

/* === Root Variables - Premium Color Palette === */
:root {
    /* Primary Brand Colors */
    --limud-primary: #FF5A00;
    --limud-primary-light: #FF8533;
    --limud-primary-dark: #cc4800;
    --limud-accent: #FF5A00;
    --limud-accent-light: #FF8533;
    --limud-gradient-start: #FF5A00;
    --limud-gradient-end: #FF5A00;

    /* Neutral Colors */
    --limud-white: #FFFFFF;
    --limud-light: #FAFAFA;
    --limud-light-gray: #EEEEEE;
    --limud-gray: #AAAAAA;
    --limud-dark-gray: #666666;
    --limud-dark: #2D2D2D;

    /* Semantic Colors */
    --limud-success: #4ECB71;
    --limud-info: #5BC0DE;
    --limud-warning: #FFC107;
    --limud-danger: #FF5252;

    /* Shadows & Effects */
    --limud-shadow-sm: none;
    --limud-shadow: none;
    --limud-shadow-md: none;
    --limud-shadow-lg: none;
    --limud-shadow-xl: none;
    --limud-shadow-btn: none;

    /* Transitions */
    --limud-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --limud-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --limud-transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Border Radius */
    --limud-radius-sm: 8px;
    --limud-radius: 12px;
    --limud-radius-lg: 16px;
    --limud-radius-xl: 24px;
    --limud-radius-pill: 50px;

    /* Typography */
    --limud-font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Pretendard', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* === Global Reset === */
.limud-survey-wrapper *,
.limud-results-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === Main Container === */
.limud-survey-wrapper {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: var(--limud-font-family);
    background: transparent;
    min-height: auto;
}

/* === Survey Steps Container === */
.limud-survey-step {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--limud-transition-slow);
}

.limud-survey-step.active {
    display: block;
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* === Survey Content Card === */
.limud-survey-content {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    position: relative;
    overflow: visible;
    text-align: center;
}

.limud-survey-content::before {
    display: none;
}

/* === Step Indicator === */
.limud-step-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--limud-primary);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 28px;
    box-shadow: none;
    letter-spacing: 0;
    text-transform: none;
    padding: 0;
}

.limud-step-indicator span {
    color: var(--limud-primary) !important;
}

/* === Typography === */
.limud-survey-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--limud-dark);
    margin-bottom: 32px;
    line-height: 1.4;
    letter-spacing: -0.3px;
}

.limud-survey-subtitle {
    font-size: 16px;
    color: var(--limud-gray);
    margin-bottom: 36px;
    line-height: 1.6;
    font-weight: 400;
}

/* === Images === */
.limud-survey-image {
    margin: 28px 0;
    text-align: center;
    border-radius: var(--limud-radius-lg);
    overflow: hidden;
    box-shadow: none;
    transition: var(--limud-transition);
}

.limud-survey-image:hover {
    transform: none;
    box-shadow: none;
}

.limud-survey-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: var(--limud-radius-lg);
}

/* === Name Card === */
.limud-name-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    max-width: 480px;
    margin: 0 auto 32px;
}

/* === Name Input === */
.limud-name-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 100%;
    margin: 0 auto;
    align-items: center;
}

.limud-name-input {
    width: 100%;
    padding: 20px 28px;
    font-size: 16px;
    border: 1px solid #E0E0E0 !important;
    border-radius: 50px !important;
    transition: var(--limud-transition);
    outline: none;
    font-family: var(--limud-font-family);
    background: #FFFFFF;
    text-align: left;
    color: var(--limud-dark);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.limud-name-input:focus {
    background: #F0F0F4;
    box-shadow: none;
    transform: none;
}

.limud-name-input::placeholder {
    color: #B0B0B0;
    font-weight: 400;
    font-size: 14px;
}

/* Name step layout */
.limud-step-name .limud-btn-start {
    margin-top: 0;
    min-width: 200px;
    padding: 15px 40px;
    font-size: 15px;
}

.limud-step-name .limud-survey-title {
    margin-bottom: 24px;
}

/* === Survey Options Grid === */
.limud-survey-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 32px auto;
    max-width: 600px;
}

/* Single column for detailed options */
.limud-step-2 .limud-survey-options,
.limud-step-3 .limud-survey-options {
    flex-direction: column;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* === Option Buttons === */
.limud-option-btn {
    flex: 1;
    min-width: 140px;
    background: var(--limud-white);
    border: 1px solid #E0E0E0;
    border-radius: var(--limud-radius-sm);
    padding: 16px 20px;
    cursor: pointer;
    transition: var(--limud-transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--limud-dark);
    position: relative;
    overflow: visible;
    text-align: center;
    min-height: auto;
    box-shadow: none;
}

.limud-option-btn::before {
    display: none;
}

.limud-option-btn:hover {
    transform: translateY(-2px);
    box-shadow: none;
    border-color: var(--limud-primary);
    background: var(--limud-primary);
    color: white;
}

.limud-option-btn:hover .option-text strong,
.limud-option-btn:hover .option-text small {
    color: white !important;
}

.limud-option-btn:active {
    transform: translateY(0);
}

.limud-option-btn.selected {
    background: #E0E0E0;
    border-color: #E0E0E0;
    color: var(--limud-dark);
    box-shadow: none;
}

.limud-option-btn.selected .option-text strong {
    color: var(--limud-dark) !important;
}

.limud-option-btn.selected .option-text small {
    color: var(--limud-gray) !important;
}

/* Multi-line option buttons */
.limud-step-2 .limud-option-btn,
.limud-step-3 .limud-option-btn {
    align-items: flex-start;
    text-align: left;
    padding: 20px 24px;
    min-height: auto;
    border-radius: var(--limud-radius-sm);
}

.limud-option-btn .option-icon {
    font-size: 36px;
    z-index: 1;
    filter: none;
}

.limud-option-btn .option-text {
    z-index: 1;
    line-height: 1.5;
    width: 100%;
}

.limud-option-btn .option-text strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
    color: var(--limud-dark);
    transition: var(--limud-transition-fast);
    font-weight: 700;
}

.limud-option-btn .option-text small {
    display: block;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.6;
    color: var(--limud-gray);
    transition: var(--limud-transition-fast);
}

/* === Buttons === */
.limud-btn {
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--limud-radius-pill);
    cursor: pointer;
    transition: var(--limud-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    outline: none;
    font-family: var(--limud-font-family);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.limud-btn::before {
    display: none;
}

/* Primary Button - Coral to Pink Gradient Pill */
.limud-btn-start,
.limud-btn-primary {
    background: var(--limud-primary);
    color: white !important;
    box-shadow: none;
    border: none !important;
    min-width: 240px;
    padding: 18px 44px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 50px !important;
}

.limud-btn-start:hover,
.limud-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: none;
    filter: brightness(0.93);
}

.limud-btn-start:active,
.limud-btn-primary:active {
    transform: translateY(0);
    filter: brightness(0.88);
}

/* Back Button */
.limud-btn-back {
    background: transparent;
    color: var(--limud-gray);
    border: 1.5px solid #E0E0E0;
    margin-top: 16px;
    box-shadow: none;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 600;
}

.limud-btn-back:hover {
    background: var(--limud-light);
    color: var(--limud-dark);
    border-color: var(--limud-dark-gray);
    transform: none;
}

/* Restart Button */
.limud-btn-restart {
    background: transparent;
    color: #999;
    border: none;
    margin-top: 24px;
    padding: 14px 36px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: underline;
}

.limud-btn-restart:hover {
    color: #666;
    transform: none;
}

/* === Outlined Step Buttons (Result Pages) === */
.limud-btn-outline {
    min-width: 220px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 800;
    box-shadow: none;
    letter-spacing: -0.5px;
    border: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.limud-btn-outline .step-label {
    font-family: Arial, -apple-system, sans-serif;
    font-weight: 900;
    font-size: 20px;
    margin-right: 8px;
    letter-spacing: 0px;
    line-height: 1;
    position: relative;
    top: 3px;
    /* Optical alignment shift down to match Noto Sans KR baseline */
}

/* STEP 1 - Blue */
.limud-btn-step1 {
    background: #00BFFF;
    border-color: #00BFFF;
    color: white;
    border-radius: 50px;
}

.limud-btn-step1 .step-label {
    color: white;
}

.limud-btn-step1:hover {
    background: #00BFFF;
    color: white;
    border-color: #00BFFF;
    box-shadow: none;
    transform: translateY(-2px);
}

.limud-btn-step1:hover .step-label {
    color: white;
}

/* STEP 2 - Yellow/Gold */
.limud-btn-step2 {
    background: #FFB800;
    border-color: #FFB800;
    color: white;
    border-radius: 50px;
}

.limud-btn-step2 .step-label {
    color: white;
}

.limud-btn-step2:hover {
    background: #FFB800;
    color: white;
    border-color: #FFB800;
    box-shadow: none;
    transform: translateY(-2px);
}

.limud-btn-step2:hover .step-label {
    color: white;
}

/* STEP 3 - Pink */
.limud-btn-step3 {
    background: #FF0055;
    border-color: #FF0055;
    color: white;
    border-radius: 50px;
}

.limud-btn-step3 .step-label {
    color: white;
}

.limud-btn-step3:hover {
    background: #FF0055;
    color: white;
    border-color: #FF0055;
    box-shadow: none;
    transform: translateY(-2px);
}

.limud-btn-step3:hover .step-label {
    color: white;
}

/* === Step Progress Dots === */
.limud-step-progress {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.limud-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #F0E0E0;
    transition: var(--limud-transition);
}

.limud-step-dot.active {
    background: #5B9CFF;
    width: 10px;
}

.limud-step-dot:nth-child(2) {
    background: #FFB0B0;
}

.limud-step-dot:nth-child(3) {
    background: #F0E0E0;
}

.limud-step-dot.completed {
    background: #5B9CFF;
}

/* === Result Icon === */
.limud-result-icon {
    margin-bottom: 20px;
    display: block;
    text-align: center;
}

.limud-top-icon {
    height: 40px;
    width: auto;
    display: inline-block;
}

.limud-step-result .limud-survey-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
}

/* === Result Content === */
.limud-result-content {
    margin: 32px 0;
}

.limud-result-description {
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 40px;
    text-align: center;
    letter-spacing: -0.5px;
}

.limud-result-description strong {
    font-weight: 800;
    color: #000;
}

.limud-lecture-links {
    margin: 28px 0;
    text-align: center;
}

/* === Loading Overlay === */
.limud-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}

.limud-loading-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.limud-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #F0F0F0;
    border-top-color: var(--limud-gradient-start);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.limud-loading-overlay p {
    color: var(--limud-dark);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* === Success Message === */
.limud-success-message {
    display: none;
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--limud-primary);
    color: white;
    padding: 16px 28px;
    border-radius: var(--limud-radius-pill);
    box-shadow: none;
    z-index: 10000;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 15px;
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.limud-success-message.show {
    display: flex;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

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

.success-icon {
    width: 28px;
    height: 28px;
    background: white;
    color: #4ECB71;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
}

/* === Results Dashboard === */
.limud-results-wrapper {
    max-width: 1400px;
    margin: 60px auto;
    padding: 24px;
    font-family: var(--limud-font-family);
}

.limud-results-header {
    margin-bottom: 48px;
    text-align: center;
}

.limud-results-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--limud-dark);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.limud-results-subtitle {
    font-size: 16px;
    color: var(--limud-gray);
    margin-bottom: 40px;
}

/* === Stats Cards === */
.limud-results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--limud-primary);
    color: white;
    padding: 28px;
    border-radius: var(--limud-radius-lg);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--limud-transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: none;
}

.stat-number {
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* === Empty State === */
.limud-empty-state {
    text-align: center;
    padding: 80px 24px;
    background: var(--limud-white);
    border-radius: var(--limud-radius-xl);
    border: 1.5px solid var(--limud-light-gray);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.4;
}

.limud-empty-state h3 {
    font-size: 24px;
    color: var(--limud-dark);
    margin-bottom: 10px;
    font-weight: 700;
}

.limud-empty-state p {
    font-size: 15px;
    color: var(--limud-gray);
    line-height: 1.6;
}

/* === Results Table === */
.limud-results-table-wrapper {
    background: var(--limud-white);
    border-radius: var(--limud-radius-lg);
    border: 1.5px solid var(--limud-light-gray);
    overflow: hidden;
    margin-bottom: 28px;
}

.limud-results-table {
    width: 100%;
    border-collapse: collapse;
}

.limud-results-table thead {
    background: linear-gradient(135deg, var(--limud-gradient-start) 0%, var(--limud-accent) 100%);
    color: white;
}

.limud-results-table th {
    padding: 16px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.limud-results-table tbody tr {
    border-bottom: 1px solid var(--limud-light-gray);
    transition: var(--limud-transition-fast);
}

.limud-results-table tbody tr:hover {
    background: var(--limud-light);
}

.limud-results-table td {
    padding: 16px;
    font-size: 14px;
}

.col-id {
    font-weight: 700;
    color: var(--limud-gradient-start);
}

.col-name strong {
    color: var(--limud-dark);
    font-size: 15px;
    font-weight: 600;
}

.user-badge {
    display: block;
    font-size: 12px;
    color: var(--limud-gray);
    margin-top: 4px;
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: var(--limud-radius-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-age {
    background: rgba(255, 107, 107, 0.1);
    color: var(--limud-gradient-start);
}

.badge-trait {
    background: rgba(255, 105, 180, 0.1);
    color: var(--limud-accent);
}

.badge-goal {
    background: rgba(78, 203, 113, 0.1);
    color: var(--limud-success);
}

/* === Purchase Status === */
.purchase-status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: var(--limud-radius-pill);
    font-size: 12px;
    font-weight: 600;
}

.status-yes {
    background: rgba(78, 203, 113, 0.1);
    color: var(--limud-success);
}

.status-no {
    background: rgba(255, 82, 82, 0.1);
    color: var(--limud-danger);
}

.status-unknown {
    background: rgba(170, 170, 170, 0.1);
    color: var(--limud-gray);
}

.col-date .time {
    display: block;
    font-size: 12px;
    color: var(--limud-gray);
    margin-top: 4px;
}

/* === Results Footer === */
.limud-results-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    background: var(--limud-white);
    border-radius: var(--limud-radius);
    border: 1.5px solid var(--limud-light-gray);
}

.results-info {
    color: var(--limud-gray);
    font-size: 14px;
    font-weight: 500;
}

.limud-btn-export {
    background: linear-gradient(135deg, #4ECB71 0%, #3BB85C 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(78, 203, 113, 0.25);
}

.limud-btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(78, 203, 113, 0.35);
}

/* === Error Message === */
.limud-error-message {
    background: rgba(255, 82, 82, 0.08);
    color: var(--limud-danger);
    padding: 16px 24px;
    border-radius: var(--limud-radius);
    border-left: 3px solid var(--limud-danger);
    font-weight: 600;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .limud-survey-wrapper {
        padding: 24px 16px;
        margin: 0 auto;
    }

    .limud-survey-title {
        font-size: 22px;
    }

    .limud-survey-subtitle {
        font-size: 14px;
    }

    .limud-survey-options {
        grid-template-columns: 1fr;
    }

    .limud-results-table-wrapper {
        overflow-x: auto;
    }

    .limud-results-table {
        min-width: 800px;
    }

    .limud-results-footer {
        flex-direction: column;
        gap: 16px;
    }

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

    .limud-btn-start,
    .limud-btn-primary {
        min-width: 180px;
        padding: 16px 36px;
        font-size: 16px;
    }

    .limud-btn-outline {
        min-width: 180px;
        padding: 16px 36px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .limud-survey-wrapper {
        padding: 20px 12px;
    }

    .limud-survey-title {
        font-size: 20px;
    }

    .limud-option-btn .option-icon {
        font-size: 32px;
    }

    .limud-btn {
        width: 100%;
        padding: 14px 24px;
    }

    .limud-btn-start,
    .limud-btn-primary {
        width: 100%;
        min-width: auto;
    }

    .limud-btn-outline {
        width: 100%;
        min-width: auto;
    }

    .limud-success-message {
        right: 12px;
        left: 12px;
        top: 12px;
    }

    .limud-name-input-wrapper {
        max-width: 100%;
    }
}

/* === Print Styles === */
@media print {

    .limud-btn,
    .limud-loading-overlay,
    .limud-success-message {
        display: none !important;
    }

    .limud-survey-content {
        box-shadow: none;
        border: 1px solid var(--limud-light-gray);
    }
}