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

html {
    width: 100%;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
}

/* Main container - split layout */
.container {
    display: flex;
    gap: 20px;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

/* Panels */
.panel {
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.left-panel {
    flex: 1;
    min-width: 300px;
}

.right-panel {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

/* Panel headers */
.panel-header {
    margin-bottom: 8px;
}

.panel-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 6px 0;
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 50%, #ff9ff3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.panel-header h1::before,
.panel-header h1::after {
    display: none;
}

.panel-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

.emoji {
    font-size: 32px;
    display: inline-block;
    animation: wiggle 3s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.subtitle {
    color: #888;
    font-size: 15px;
    margin-bottom: 28px;
}

.subtitle::before {
    content: '🍬';
    margin-right: 6px;
    animation: bounce 2s ease-in-out infinite;
}

.subtitle::after {
    content: '🍬';
    margin-left: 6px;
    animation: bounce 2s ease-in-out infinite 0.3s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Labels */
.input-label,
.section-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

/* Input section */
.input-section {
    margin-bottom: 24px;
}

#sugarInput {
    width: 100%;
    font-size: 32px;
    font-weight: 600;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 12px;
}

#sugarInput:focus {
    border-color: #ff6b6b;
}

.stepper {
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 20px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.stepper:hover {
    background: #ff5252;
}

.stepper:active {
    transform: scale(0.98);
}

/* Unit toggle */
.toggle-section {
    margin-bottom: 24px;
}

.unit-toggle {
    display: flex;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 4px;
}

.toggle-btn {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: white;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toggle-btn:hover:not(.active) {
    color: #1a1a1a;
}

/* Settings section */
.settings-row {
    display: flex;
    gap: 10px;
}

.icon-btn {
    flex: 1;
    font-size: 14px;
    padding: 12px 16px;
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #e0e0e0;
    color: #1a1a1a;
}

.country-select {
    flex: 1;
    font-size: 13px;
    padding: 12px 14px;
    background: #f5f5f5;
    color: #1a1a1a;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    outline: none;
}

.country-select:hover {
    background: #e0e0e0;
}

/* Output section */
.output-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 0;
}

.empty-state {
    text-align: center;
    color: #888;
}

.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

.result-content {
    display: none;
    text-align: center;
}

.result-content.active {
    display: block;
}

.spoon-count {
    font-size: 64px;
    font-weight: 800;
    color: #d63031;
    margin-bottom: 12px;
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.spoon-emojis {
    font-size: 36px;
    margin-bottom: 20px;
    line-height: 1.4;
    display: inline-block;
}

.spoon-emojis .spoon {
    display: inline-block;
    animation: spoonPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) backwards;
}

@keyframes spoonPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.one-liner {
    font-size: 18px;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 12px;
    animation: fadeInUp 0.5s ease-out 0.2s backwards;
}

@keyframes fadeInUp {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.share-btn {
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 16px 0 8px;
    animation: fadeInUp 0.5s ease-out 0.4s backwards;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

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

.share-btn.copied {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.who-guideline {
    font-size: 13px;
    color: #636e72;
    font-weight: 500;
}

/* Mobile responsive - stack vertically */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        flex-direction: column;
        gap: 10px;
    }

    .left-panel,
    .right-panel {
        min-width: 0;
        flex: none;
        width: 100%;
    }

    .panel {
        padding: 18px;
        border-radius: 18px;
    }

    /* Header */
    .panel-header h1 {
        font-size: 24px;
    }

    .panel-header h2 {
        font-size: 18px;
    }

    .emoji {
        font-size: 24px;
    }

    .subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }

    /* Labels */
    .input-label,
    .section-label {
        font-size: 11px;
        margin-bottom: 8px;
    }

    /* Input section */
    #sugarInput {
        font-size: 26px;
        padding: 12px 16px;
        border-radius: 14px;
        margin-bottom: 10px;
    }

    .stepper {
        font-size: 14px;
        padding: 12px 16px;
        border-radius: 10px;
    }

    /* Toggle */
    .toggle-btn {
        font-size: 13px;
        padding: 10px;
    }

    /* Settings */
    .icon-btn,
    .country-select {
        font-size: 12px;
        padding: 10px 12px;
    }

    /* Output section */
    .output-section {
        padding: 16px 0;
        min-height: 150px;
    }

    .empty-state .empty-icon {
        font-size: 48px;
        margin-bottom: 12px;
    }

    .empty-state p {
        font-size: 13px;
    }

    .spoon-count {
        font-size: 42px;
        margin-bottom: 8px;
    }

    .spoon-emojis {
        font-size: 26px;
        margin-bottom: 14px;
    }

    .one-liner {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .share-btn {
        font-size: 13px;
        padding: 10px 16px;
        margin: 12px 0 6px;
        border-radius: 10px;
    }

    .who-guideline {
        font-size: 11px;
    }

    /* About section on mobile */
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-title {
        font-size: 22px;
    }

    .coffee-text {
        font-size: 14px;
    }

    /* About page mobile */
    .about-page .about-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 24px;
    }

    .about-page .about-card {
        padding: 20px;
    }

    .about-page .about-icon {
        font-size: 32px;
    }

    .about-page .about-card h2 {
        font-size: 16px;
    }

    .about-page .about-card p {
        font-size: 13px;
    }

    .about-intro p {
        font-size: 15px;
    }

    .about-page .about-footer {
        padding: 20px;
    }

    .about-page .about-footer p {
        font-size: 13px;
    }
}

/* Quick Links Buttons */
.quick-links {
    max-width: 900px;
    margin: 20px auto 40px;
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 0 20px;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.quick-link:hover {
    transform: translateY(-2px);
}

.about-link {
    background: #f5f5f5;
    color: #666;
}

.about-link:hover {
    background: #e0e0e0;
    color: #1a1a1a;
}

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

.coffee-link:hover {
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.quick-icon {
    font-size: 16px;
}

/* About Page Styles */
body.about-page-body {
    padding: 20px;
}

.page-header {
    max-width: 800px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.back-btn {
    display: inline-block;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.back-btn:hover {
    color: #1a1a1a;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 50%, #ff9ff3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-page {
    max-width: 800px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.about-intro {
    text-align: center;
    margin-bottom: 40px;
}

.about-intro p {
    font-size: 18px;
    color: #666;
}

.about-page .about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.about-page .about-card {
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.about-page .about-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.about-page .about-icon {
    font-size: 36px;
    margin-bottom: 16px;
}

.about-page .about-card h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.about-page .about-card p {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
    margin-bottom: 8px;
}

.about-page .about-card p:last-child {
    margin-bottom: 0;
}

.about-page .about-footer {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.about-page .about-footer p {
    font-size: 15px;
    color: #888;
    margin-bottom: 8px;
}

.about-page .about-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.about-page .about-footer a:hover {
    text-decoration: underline;
}

.floating-coffee {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 100;
}

.floating-coffee:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

/* About Page Mobile - MUST come after all other styles */
@media (max-width: 768px) {
    .about-page .about-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .page-title {
        font-size: 22px !important;
    }

    .about-page .about-card {
        padding: 20px !important;
    }

    .about-page .about-icon {
        font-size: 32px !important;
        margin-bottom: 12px;
    }

    .about-page .about-card h2 {
        font-size: 16px !important;
    }

    .about-page .about-card p {
        font-size: 13px !important;
    }

    .about-intro p {
        font-size: 15px !important;
    }

    .about-page .about-footer {
        padding: 20px !important;
    }

    .about-page .about-footer p {
        font-size: 13px !important;
    }

    .floating-coffee {
        bottom: 12px;
        right: 12px;
        padding: 10px 16px;
        font-size: 13px;
    }
}
