:root {
    --twosome-red: #D01117;
    --twosome-red-hover: #b00e13;
    --bg-light: #FFFFFF;
    --bg-secondary: #F8F8F8;
    --card-bg: #FFFFFF;
    --glass-border: rgba(0, 0, 0, 0.1);
    --text-main: #222222;
    --text-dim: #666666;
    --gold: #C5A059;
    --font-main: 'Outfit', 'Noto Sans KR', sans-serif;
}

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

body {
    background-color: var(--bg-secondary);
    color: var(--text-main);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 50px;
}

.logo-pattern-band {
    background: #000;
    width: 100vw;
    margin-left: calc(-50vw + 50%); /* Full width on centered container */
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.logo-pattern-band::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background-image: url('투썸_로고.png');
    background-size: 150px auto;
    background-repeat: repeat;
    filter: brightness(0) invert(1); /* Make it white */
    opacity: 0.2; /* Subtle pattern */
    animation: scrollPattern 20s linear infinite;
}

@keyframes scrollPattern {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.main-logo-white {
    height: 25px;
    position: relative;
    z-index: 2;
    filter: brightness(0) invert(1);
}

header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.2;
    margin-top: 10px;
    color: #111;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
}

.step {
    font-size: 1.1rem;
    color: var(--text-dim);
    position: relative;
    padding-bottom: 10px;
}

.step.active {
    color: var(--twosome-red);
    font-weight: 600;
}

.step.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--twosome-red);
    border-radius: 2px;
}

/* Main Layout */
main {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.content-wrapper {
    min-height: 600px;
    position: relative;
}

.selection-section {
    display: none;
    animation: slideIn 0.4s ease-out forwards;
}

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

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

.section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.back-btn {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.back-btn:hover {
    background: var(--card-bg);
}

/* Member Grid */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.member-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 20px 10px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.member-card:hover {
    background: var(--twosome-red);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(208, 17, 23, 0.2);
}

.member-card.selected {
    background: var(--twosome-red);
    color: white;
    border-color: var(--twosome-red);
}

.member-card.disabled {
    background: #E0E0E0;
    color: #999;
    cursor: not-allowed;
    border-color: #CCC;
    pointer-events: none;
    box-shadow: none;
}

.member-card.disabled:hover {
    transform: none;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--twosome-red);
    border-color: var(--twosome-red);
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.menu-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 80px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.menu-card:hover {
    background: var(--twosome-red);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(208, 17, 23, 0.2);
}

.custom-input-container {
    grid-column: 1 / -1;
    background: #FFFFFF;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.custom-input {
    width: 100%;
    max-width: 400px;
    padding: 15px 20px;
    border: 2px solid #EEE;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

.custom-input:focus {
    border-color: var(--twosome-red);
    box-shadow: 0 0 0 4px rgba(208, 17, 23, 0.1);
}

.menu-name {
    font-size: 1rem;
    font-weight: 500;
    word-break: keep-all;
}

/* Options */
.option-card {
    padding: 40px;
    border-radius: 24px;
    max-width: 600px;
    margin: 0 auto;
}

.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.selected-preview {
    text-align: center;
    margin-bottom: 30px;
}

.selected-preview h2 {
    color: var(--twosome-red);
    font-size: 2rem;
}

.option-group {
    margin-bottom: 30px;
}

.option-group h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-dim);
}

.toggle-switch {
    display: flex;
    background: #EEEEEE;
    border-radius: 12px;
    padding: 5px;
}

.toggle-switch input {
    display: none;
}

.toggle-switch label {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.toggle-switch input:checked + label {
    background: var(--twosome-red);
    color: white;
}

.toggle-switch input:disabled + label {
    background: #DDD;
    color: #AAA;
    cursor: not-allowed;
    opacity: 0.5;
}

.bean-selector {
    display: grid;
    gap: 10px;
}

.bean-item input {
    display: none;
}

.bean-item label {
    display: block;
    padding: 15px;
    background: #FFFFFF;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.bean-item input:checked + label {
    border-color: var(--twosome-red);
    background: rgba(208, 17, 23, 0.1);
}

.bean-name {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.bean-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.primary-btn {
    width: 100%;
    padding: 18px;
    background: var(--twosome-red);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 20px;
}

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

/* Receipt */
.receipt-section {
    margin-top: 20px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}

.receipt-container {
    width: 100%;
}

.receipt-card {
    background: #FFFFFF;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.receipt-banner {
    background: var(--twosome-red);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.banner-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    opacity: 0.9;
}

.team-tag {
    font-size: 1.1rem;
    font-weight: 700;
}

.receipt-body {
    padding: 25px;
}

.receipt-info {
    display: flex;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid #F0F0F0;
    margin-bottom: 25px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item .label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 600;
}

.time-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timer-badge {
    background: var(--twosome-red);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 800;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from { opacity: 1; }
    to { opacity: 0.7; }
}

.timer-badge.hidden {
    display: none;
}

.status-badge {
    color: var(--twosome-red);
}

.section-label {
    font-size: 0.75rem;
    color: var(--twosome-red);
    font-weight: 800;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(208, 17, 23, 0.1);
}

.order-section, .summary-section {
    margin-bottom: 30px;
}

.order-list {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 0;
}

.order-item {
    padding: 12px 0;
    border-bottom: 1px solid #FAFAFA;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-content {
    flex: 1;
}

.delete-btn {
    background: none;
    border: none;
    color: #CCC;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 10px;
    transition: all 0.2s;
    line-height: 1;
}

.delete-btn:hover {
    color: var(--twosome-red);
    transform: scale(1.2);
}

.order-item:last-child {
    border-bottom: none;
}

.order-member {
    font-size: 0.9rem;
    font-weight: 700;
    color: #333;
}

.order-menu-name {
    font-size: 0.9rem;
    color: #444;
}

.order-details {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: block;
    margin-top: 2px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
    font-weight: 700;
}

.summary-count {
    color: var(--twosome-red);
}

.receipt-footer {
    padding: 25px;
    background: #FAFAFA;
    border-top: 1px solid #F0F0F0;
}

.receipt-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

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

.action-btn.secondary {
    background: #FFFFFF;
    color: #666;
    border: 1px solid #DDD;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.footer-msg {
    margin-top: 20px;
    text-align: center;
    font-size: 0.65rem;
    color: #BBB;
    letter-spacing: 1px;
    font-weight: 600;
}

.hidden {
    display: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}
::-webkit-scrollbar-thumb {
    background: var(--twosome-red);
    border-radius: 10px;
}

/* Tablet Optimization */
@media (max-width: 1024px) {
    .receipt-container {
        position: static;
    }
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .app-container {
        padding: 20px 15px;
    }

    header {
        margin-bottom: 30px;
    }

    .logo-pattern-band {
        height: 60px;
        margin-bottom: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .progress-bar {
        gap: 10px;
        margin-bottom: 25px;
    }

    .step {
        font-size: 0.85rem;
        text-align: center;
    }

    .content-wrapper {
        min-height: auto;
    }

    .section-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }

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

    .category-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .category-tabs::-webkit-scrollbar {
        height: 4px;
    }

    .tab-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .member-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }

    .member-card {
        padding: 15px 5px;
        font-size: 0.9rem;
    }

    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .menu-card {
        min-height: 70px;
        padding: 10px;
    }

    .menu-name {
        font-size: 0.9rem;
    }

    .option-card {
        padding: 25px 20px;
    }

    .selected-preview h2 {
        font-size: 1.5rem;
    }

    .custom-input-container {
        padding: 20px;
    }

    .custom-input {
        padding: 12px;
        font-size: 1rem;
    }

    .receipt-body {
        padding: 20px 15px;
    }

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

    .receipt-footer {
        padding: 20px 15px;
    }
}
