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

:root {
    --primary-color: #FF6B6B;
    --primary-dark: #FF5252;
    --secondary-color: #4ECDC4;
    --success-color: #51CF66;
    --warning-color: #FFD93D;
    --info-color: #6C5CE7;
    --light-bg: #F7F8FA;
    --border-color: #E0E0E0;
    --text-dark: #333333;
    --text-light: #666666;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-dark);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

/* Language Switcher */
.language-switcher {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.lang-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    padding: 40px 30px;
}

/* Steps Indicator */
.steps-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 10px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 80px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step-item.active {
    opacity: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-bg);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 8px rgba(255, 107, 107, 0.1);
}

.step-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-light);
}

.step-item.active .step-label {
    color: var(--primary-color);
}

.step-connector {
    height: 3px;
    background: var(--border-color);
    flex: 1;
    margin: 20px 0;
    transition: all 0.3s ease;
    min-width: 30px;
}

/* Form Sections */
.form-section {
    display: none;
    animation: slideIn 0.4s ease;
}

.form-section.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.section-header p {
    color: var(--text-light);
    font-size: 1rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.helper-text {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 5px;
    font-weight: normal;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1);
}

textarea {
    resize: vertical;
    min-height: 150px;
    line-height: 1.6;
}

/* Focus Map */
.focus-map-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.focus-map {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.focus-map-svg {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
}

.behaviors-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.behavior-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.behavior-scoring {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 12px;
}

.behavior-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.behavior-input-group input[type="number"] {
    width: 70px;
}

.behavior-input-group .score-display {
    display: inline-block;
    padding: 5px 15px;
    background: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-left: 10px;
}

/* Golden Behaviors */
.golden-behaviors-result {
    background: linear-gradient(135deg, #FFD93D 0%, #FF8C00 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    color: white;
}

.golden-behaviors-result h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.behaviors-list-result {
    list-style: none;
}

.behaviors-list-result li {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    margin-bottom: 8px;
    backdrop-filter: blur(10px);
}

/* Micro Habits */
.micro-habits-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.micro-habit-card {
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.micro-habit-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.micro-habit-card h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.micro-habit-card .form-group {
    margin-bottom: 15px;
}

.micro-habit-card label {
    font-size: 0.95rem;
    margin-bottom: 8px;
}

/* Habit Anchors */
.habit-anchors-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.habit-anchor-item {
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
}

.habit-anchor-item h4 {
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 1rem;
}

.habit-anchor-item input {
    width: 100%;
}

/* Common Anchors */
.common-anchors {
    background: #F0F9FF;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid var(--info-color);
}

.common-anchors p {
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--info-color);
}

.anchor-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.anchor-tag {
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--info-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: var(--info-color);
    font-weight: 500;
}

.anchor-tag:hover {
    background: var(--info-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

/* Habit Celebrations */
.habit-celebrations-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.habit-celebration-item {
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
}

.habit-celebration-item h4 {
    color: var(--text-dark);
    margin-bottom: 10px;
}

.celebration-options {
    background: #FFF5F0;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid var(--warning-color);
}

.celebration-options p {
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--warning-color);
}

.celebration-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.celebration-card {
    background: white;
    border: 2px solid var(--warning-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.celebration-card:hover {
    background: var(--warning-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 217, 61, 0.3);
}

.celebration-card:hover p {
    color: white;
}

.celebration-emoji {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.celebration-card p {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--warning-color);
    transition: color 0.3s ease;
}

.celebration-card.selected {
    background: var(--warning-color);
    color: white;
}

.celebration-card.selected p {
    color: white;
}

/* Habit Table */
.preview-section {
    background: var(--light-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    overflow-x: auto;
}

.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.habit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.habit-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.habit-table th,
.habit-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.habit-table tbody tr:hover {
    background: var(--light-bg);
}

.habit-table thead th {
    font-weight: 600;
    text-align: center;
    padding: 20px 15px;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

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

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #D0D0D0;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #40C057;
}

/* Celebration Container */
.celebration-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    animation: fall 3s ease-in forwards;
}

.confetti-rainbow {
    animation: fall 3s ease-in forwards, spin 2s linear infinite;
}

@keyframes fall {
    to {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
}

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

/* Celebration text */
.celebration-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: bold;
    animation: bounce 0.8s ease;
    z-index: 10000;
}

@keyframes bounce {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
    }
}

/* Sound wave animation */
.sound-wave {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: pulse 1s ease-out forwards;
}

@keyframes pulse {
    to {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }

    .header {
        padding: 30px 20px;
    }

    .language-switcher {
        top: 15px;
        right: 15px;
        gap: 5px;
    }

    .lang-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .header h1 {
        font-size: 1.8rem;
        padding-top: 30px;
    }

    .main-content {
        padding: 25px 15px;
    }

    .steps-indicator {
        gap: 5px;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .focus-map-container {
        grid-template-columns: 1fr;
    }

    .celebration-types {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .habit-table {
        font-size: 0.8rem;
    }

    .habit-table th,
    .habit-table td {
        padding: 10px;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success Message */
.success-message {
    background: #D4EDDA;
    border: 2px solid var(--success-color);
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-message::before {
    content: '✓';
    font-weight: bold;
    font-size: 1.2rem;
}

/* Styles for printable table */
.printable-container {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 800px; /* A4-like width */
    background: white;
    padding: 20px;
}

.printable-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: black;
    background-color: white;
    border: 2px solid black;
}

.printable-table th,
.printable-table td {
    border: 1px solid black;
    padding: 12px;
    text-align: left;
}

.printable-table thead {
    background-color: #f0f0f0;
}

.printable-table th {
    font-weight: bold;
    color: black;
}

.printable-table h2 {
    text-align: center;
    margin-bottom: 20px;
    color: black;
    font-size: 24px;
}
