/* Wine Circle - Mobile-Locked iOS-Like Design */
/* Version 2.0 - German Default, DE/EN Toggle, Luxury Warm Palette */

/* =================
   CRITICAL: MOBILE FRAME ENFORCEMENT
   ================= */

html {
    background: #D4C9BC;
    height: 100%;
}

body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #D4C9BC;
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.twc-app-body,
body.twc-login-body {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    background: #F4EFE6;
    min-height: 100vh;
    box-shadow: 0 0 80px rgba(91, 29, 40, 0.15);
}

/* Force all containers to respect mobile frame */
.twc-app-container,
.twc-login-container,
.twc-container {
    max-width: 420px !important;
    width: 100% !important;
    margin: 0 auto !important;
}

* {
    box-sizing: border-box;
}

/* =================
   COLOR PALETTE (Luxury Warm)
   ================= */

:root {
    --color-primary: #7A1E2C;
    --color-wine: #5B1D28;
    --color-brown: #7B4E2C;
    --color-bg: #F4EFE6;
    --color-card: #E8E1D6;
    --color-card-light: #F8F5EF;
    --color-text: #6B6258;
    --color-text-dark: #3D3530;
    --color-gold: #C7A24A;
    --color-white: #FFFFFF;
    
    --radius-sm: 20px;
    --radius-md: 24px;
    --radius-lg: 28px;
    --radius-xl: 32px;
    
    --shadow-soft: 0 2px 12px rgba(91, 29, 40, 0.06);
    --shadow-medium: 0 4px 24px rgba(91, 29, 40, 0.1);
    --shadow-strong: 0 8px 40px rgba(91, 29, 40, 0.14);
    
    --spacing: 24px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =================
   TYPOGRAPHY (iOS-Like)
   ================= */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--color-wine);
    margin: 0;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 1.75rem;
    line-height: 1.15;
}

h2 {
    font-size: 1.4rem;
    line-height: 1.2;
}

h3 {
    font-size: 1.1rem;
    line-height: 1.3;
}

p, body {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--color-text);
    letter-spacing: 0.01em;
}

small {
    font-size: 0.8rem;
    color: var(--color-text);
}

/* =================
   LOGIN PAGE
   ================= */

.twc-login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--color-wine) 0%, var(--color-primary) 100%);
    padding: var(--spacing);
}

.twc-login-container {
    width: 100%;
    max-width: 420px;
}

.twc-login-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: 36px 24px;
    box-shadow: var(--shadow-strong);
    text-align: center;
    position: relative;
}

.twc-login-lang-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    background: var(--color-card);
    border-radius: 16px;
    padding: 3px;
    gap: 2px;
}

.twc-login-lang-toggle .twc-lang-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
}

.twc-login-logo {
    font-size: 3.5rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(91, 29, 40, 0.2));
}

.twc-login-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-wine);
    margin: 0 0 6px 0;
}

.twc-login-subtitle {
    font-size: 0.9rem;
    color: var(--color-text);
    margin: 0 0 28px 0;
    font-weight: 500;
}

.twc-login-error {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.twc-login-form {
    text-align: left;
}

.twc-login-links {
    margin-top: 20px;
    display: flex;
    gap: 16px;
    justify-content: center;
}

.twc-login-link {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.twc-login-link:hover {
    color: var(--color-primary);
}

/* =================
   TOP NAVIGATION (iOS-Like)
   ================= */

.twc-top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248, 245, 239, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(107, 98, 88, 0.08);
}

.twc-top-nav-inner {
    max-width: 420px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.twc-top-nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.twc-nav-icon {
    font-size: 1.3rem;
}

.twc-nav-brand {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-dark);
    letter-spacing: -0.01em;
}

.twc-top-nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Language Toggle */
.twc-lang-toggle {
    display: flex;
    background: var(--color-card);
    border-radius: 14px;
    padding: 3px;
    gap: 2px;
}

.twc-lang-btn {
    background: none;
    border: none;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.twc-lang-btn.active {
    background: var(--color-white);
    color: var(--color-wine);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.twc-nav-link,
.twc-nav-logout {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 14px;
    transition: all var(--transition-fast);
    background: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.twc-nav-logout {
    background: var(--color-card);
    color: var(--color-wine);
}

.twc-nav-link:active,
.twc-nav-logout:active {
    transform: scale(0.96);
}

/* =================
   APP CONTAINER
   ================= */

.twc-app-container {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    background: var(--color-bg);
    min-height: 100vh;
}

.twc-main-content {
    padding: 20px 16px 100px;
}

/* =================
   HEADINGS
   ================= */

.twc-page-heading {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-wine);
    margin: 0 0 20px 0;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.twc-page-heading::before {
    content: '🍷';
    font-size: 1.5rem;
}

.twc-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.twc-page-header .twc-page-heading {
    margin-bottom: 0;
}

.twc-section-heading {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-brown);
    margin: 0 0 14px 0;
    letter-spacing: -0.01em;
}

.twc-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.twc-text-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

/* =================
   ADMIN LOUNGE CARDS (2x2 Grid)
   ================= */

.twc-admin-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.twc-admin-card {
    background: linear-gradient(145deg, var(--color-brown) 0%, #6B4528 100%);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-medium);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.twc-admin-card:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-soft);
}

.twc-admin-card-icon {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.twc-admin-card-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-white);
    letter-spacing: -0.01em;
}

/* Quick Stats */
.twc-quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 28px;
}

.twc-stat-item {
    background: var(--color-white);
    border-radius: var(--radius-sm);
    padding: 14px 10px;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.twc-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-wine);
}

.twc-stat-label {
    font-size: 0.7rem;
    color: var(--color-text);
    margin-top: 2px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* =================
   WINE CARDS (Max 2 Columns)
   ================= */

.twc-wine-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.twc-wine-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.twc-wine-card:active {
    transform: scale(0.98);
}

.twc-wine-card-assigned {
    border: 2px solid var(--color-gold);
    box-shadow: 0 4px 20px rgba(199, 162, 74, 0.2);
}

.twc-wine-card-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: var(--color-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

.twc-wine-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.twc-wine-placeholder {
    font-size: 2.5rem;
    color: var(--color-wine);
    opacity: 0.25;
}

.twc-wine-card-body {
    padding: 12px;
    flex: 1;
}

.twc-wine-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-wine);
    margin: 0 0 4px 0;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.twc-wine-card-region {
    font-size: 0.75rem;
    color: var(--color-text);
    margin: 0 0 8px 0;
}

.twc-wine-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.twc-wine-card-footer {
    padding: 0 12px 12px;
}

/* =================
   BUTTONS (iOS-Like)
   ================= */

.twc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: -0.01em;
}

.twc-btn-primary {
    background: linear-gradient(145deg, var(--color-primary) 0%, var(--color-wine) 100%);
    color: var(--color-white);
    box-shadow: var(--shadow-soft);
}

.twc-btn-primary:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-medium);
}

.twc-btn-secondary {
    background: var(--color-brown);
    color: var(--color-white);
    box-shadow: var(--shadow-soft);
}

.twc-btn-outline {
    background: transparent;
    color: var(--color-wine);
    border: 2px solid var(--color-wine);
}

.twc-btn-outline:active {
    background: var(--color-wine);
    color: var(--color-white);
}

.twc-btn-text {
    background: transparent;
    color: var(--color-text);
    min-height: auto;
    padding: 8px 12px;
}

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

.twc-btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
    min-height: 36px;
    border-radius: var(--radius-sm);
}

.twc-btn-block {
    width: 100%;
}

/* =================
   BADGES
   ================= */

.twc-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.twc-badge-red {
    background: var(--color-primary);
    color: var(--color-white);
}

.twc-badge-white {
    background: var(--color-gold);
    color: var(--color-text-dark);
}

.twc-badge-rosé,
.twc-badge-rose {
    background: #F5D0D6;
    color: #8B4A5A;
}

.twc-badge-count {
    background: var(--color-wine);
    color: var(--color-white);
}

.twc-badge-pending {
    background: var(--color-gold);
    color: var(--color-text-dark);
}

.twc-badge-admin {
    background: var(--color-wine);
    color: var(--color-white);
}

.twc-badge-status-approved {
    background: #D4EDDA;
    color: #155724;
}

.twc-badge-status-pending {
    background: var(--color-gold);
    color: var(--color-text-dark);
}

.twc-rating-badge {
    font-size: 0.7rem;
}

/* =================
   FLOATING ACTION BUTTON
   ================= */

.twc-fab {
    position: fixed;
    bottom: 24px;
    right: calc(50% - 190px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--color-primary) 0%, var(--color-wine) 100%);
    color: var(--color-white);
    border: none;
    box-shadow: var(--shadow-strong);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 99;
    -webkit-tap-highlight-color: transparent;
}

.twc-fab:active {
    transform: scale(0.92);
}

.twc-fab-icon {
    font-size: 1.75rem;
    line-height: 1;
    font-weight: 300;
}

/* =================
   MODALS (iOS-Like Slide-Up)
   ================= */

.twc-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 0;
}

.twc-modal.show {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.twc-modal-content {
    background: var(--color-white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-width: 420px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-strong);
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0.8;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.twc-modal-header {
    padding: 20px 20px 12px;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--color-white);
    z-index: 1;
}

.twc-modal-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: var(--color-card);
    border-radius: 2px;
}

.twc-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-wine);
}

.twc-modal-close {
    background: var(--color-card);
    border: none;
    font-size: 1.25rem;
    color: var(--color-text);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.twc-modal-close:active {
    transform: scale(0.92);
}

.twc-modal-body {
    padding: 0 20px 20px;
}

.twc-modal-footer {
    padding: 12px 20px 28px;
    border-top: none;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* =================
   FORMS (iOS-Like)
   ================= */

.twc-form-group {
    margin-bottom: 16px;
}

.twc-form-label {
    display: block;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.twc-form-input,
.twc-form-textarea,
.twc-search-input,
.twc-filter-select {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    background: var(--color-card);
    color: var(--color-text-dark);
    -webkit-appearance: none;
}

.twc-form-input:focus,
.twc-form-textarea:focus,
.twc-search-input:focus,
.twc-filter-select:focus {
    outline: none;
    background: var(--color-card-light);
    box-shadow: 0 0 0 3px rgba(122, 30, 44, 0.1);
}

.twc-form-input::placeholder,
.twc-form-textarea::placeholder,
.twc-search-input::placeholder {
    color: var(--color-text);
    opacity: 0.6;
}

.twc-form-textarea {
    resize: vertical;
    min-height: 90px;
}

.twc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.twc-form-help {
    font-size: 0.75rem;
    color: var(--color-text);
    margin-top: 6px;
    font-style: italic;
}

/* =================
   CARDS
   ================= */

.twc-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

.twc-card-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-wine);
    margin: 0 0 16px 0;
}

.twc-mission-card {
    background: linear-gradient(145deg, var(--color-card-light) 0%, var(--color-white) 100%);
}

/* =================
   LISTS (iOS-Like)
   ================= */

.twc-wine-list,
.twc-orders-list,
.twc-ratings-list,
.twc-user-list,
.twc-rated-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.twc-wine-list-item,
.twc-order-item,
.twc-rating-item,
.twc-user-item,
.twc-rated-card {
    background: var(--color-white);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-soft);
}

.twc-wine-list-image,
.twc-rated-card-image {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

.twc-wine-list-image img,
.twc-rated-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.twc-wine-placeholder-sm {
    font-size: 1.5rem;
    color: var(--color-wine);
    opacity: 0.25;
}

.twc-wine-list-content,
.twc-order-content,
.twc-rating-body,
.twc-user-content,
.twc-rated-card-content {
    flex: 1;
    min-width: 0;
}

.twc-wine-list-title,
.twc-order-wine,
.twc-rating-wine-name,
.twc-user-email,
.twc-wine-title {
    font-weight: 600;
    color: var(--color-wine);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.twc-wine-list-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--color-text);
}

.twc-wine-list-actions,
.twc-order-actions,
.twc-user-actions,
.twc-rated-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Rating Item */
.twc-rating-item {
    flex-direction: column;
    align-items: flex-start;
}

.twc-rating-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: flex-start;
}

.twc-rating-stars {
    font-size: 0.85rem;
}

.twc-rating-user {
    font-size: 0.8rem;
    color: var(--color-text);
}

.twc-rating-comment {
    font-size: 0.85rem;
    color: var(--color-text);
    margin-top: 6px;
    font-style: italic;
}

.twc-rating-footer {
    margin-top: 8px;
}

.twc-rating-date,
.twc-order-date {
    font-size: 0.75rem;
    color: var(--color-text);
    opacity: 0.8;
}

/* Order Item */
.twc-order-member {
    font-size: 0.8rem;
    color: var(--color-text);
    margin-top: 2px;
}

.twc-order-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

/* User Item */
.twc-user-meta {
    margin-top: 4px;
}

/* =================
   MEMBER LIST (Checkboxes)
   ================= */

.twc-member-list {
    max-height: 200px;
    overflow-y: auto;
    background: var(--color-card);
    border-radius: var(--radius-sm);
    padding: 8px;
}

.twc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 12px;
    transition: background var(--transition-fast);
    font-size: 0.85rem;
    color: var(--color-text-dark);
}

.twc-checkbox-label:active {
    background: var(--color-card-light);
}

.twc-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--color-wine);
}

/* =================
   ASSIGNED SECTION
   ================= */

.twc-assigned-section {
    background: linear-gradient(145deg, rgba(199, 162, 74, 0.1) 0%, rgba(199, 162, 74, 0.05) 100%);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 28px;
    border: 1px solid rgba(199, 162, 74, 0.2);
}

/* =================
   PREVIEW SECTIONS
   ================= */

.twc-preview-section {
    margin-bottom: 28px;
}

.twc-wine-grid-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.twc-wine-card-compact {
    background: var(--color-white);
    border-radius: var(--radius-sm);
    padding: 12px;
    box-shadow: var(--shadow-soft);
}

.twc-wine-card-compact .twc-wine-card-content {
    margin-bottom: 10px;
}

.twc-wine-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-wine);
    margin: 0 0 4px 0;
}

.twc-wine-region {
    font-size: 0.75rem;
    color: var(--color-text);
    margin: 0 0 6px 0;
}

/* =================
   FILTERS BAR
   ================= */

.twc-filters-bar {
    margin-bottom: 16px;
}

.twc-filter-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.twc-search-input {
    flex: 1;
    min-width: 0;
}

.twc-filter-select {
    width: auto;
    min-width: 100px;
}

.twc-ratings-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.twc-search-form {
    display: flex;
    gap: 8px;
    flex: 1;
}

/* =================
   EMPTY STATES
   ================= */

.twc-empty-state {
    text-align: center;
    padding: 32px 20px;
    background: var(--color-card);
    border-radius: var(--radius-md);
    margin: 16px 0;
}

.twc-empty-text {
    color: var(--color-text);
    font-size: 0.9rem;
    font-style: italic;
}

/* =================
   WINE DETAIL PAGE
   ================= */

.twc-wine-detail-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

.twc-wine-detail-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--color-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

.twc-wine-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.twc-wine-placeholder-lg {
    font-size: 4rem;
    color: var(--color-wine);
    opacity: 0.2;
}

.twc-wine-detail-content {
    padding: 20px;
}

.twc-wine-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-wine);
    margin: 0 0 12px 0;
}

.twc-wine-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.twc-wine-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.twc-detail-item {
    text-align: center;
    padding: 12px;
    background: var(--color-card);
    border-radius: var(--radius-sm);
}

.twc-detail-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 4px;
}

.twc-detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-dark);
}

.twc-wine-description {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-card);
}

.twc-wine-description h3 {
    margin-bottom: 8px;
}

.twc-wine-description p {
    margin: 0;
}

/* =================
   RATING MODULE
   ================= */

.twc-rating-module {
    padding: 20px;
    background: var(--color-card-light);
    border-top: 1px solid var(--color-card);
}

.twc-rating-heading {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.twc-stars-container {
    margin-bottom: 16px;
}

.twc-stars-input {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.twc-star {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--color-card);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.twc-star.active,
.twc-star:hover {
    color: var(--color-gold);
    transform: scale(1.1);
}

.twc-rating-timestamp {
    margin-top: 16px;
    text-align: center;
    color: var(--color-text);
}

.twc-alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

.twc-alert-success {
    background: #D4EDDA;
    color: #155724;
}

.twc-alert-error {
    background: var(--color-primary);
    color: var(--color-white);
}

/* =================
   RATED CARD
   ================= */

.twc-rated-card {
    flex-direction: column;
    align-items: stretch;
}

.twc-rated-card .twc-rated-card-image {
    width: 100%;
    height: 140px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.twc-rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.twc-stars-display {
    font-size: 0.9rem;
}

.twc-rating-count {
    font-size: 0.8rem;
    color: var(--color-text);
    font-weight: 500;
}

.twc-comment-display {
    background: var(--color-card);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 8px 0;
}

.twc-comment-display p {
    margin: 0;
    font-size: 0.85rem;
    font-style: italic;
}

.twc-rated-meta {
    font-size: 0.75rem;
    color: var(--color-text);
    margin-top: 8px;
}

/* =================
   HELP PAGE
   ================= */

.twc-help {
    color: var(--color-text-dark);
}

.twc-help-section {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-soft);
}

.twc-help-section h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--color-wine);
}

.twc-help-section h3 {
    font-size: 0.95rem;
    margin: 16px 0 10px;
    color: var(--color-brown);
}

.twc-help-section p {
    margin: 0 0 12px;
    font-size: 0.9rem;
}

.twc-help-section ul,
.twc-help-section ol {
    margin: 0;
    padding-left: 20px;
}

.twc-help-section li {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* =================
   TOAST NOTIFICATIONS
   ================= */

.twc-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text-dark);
    color: var(--color-white);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-strong);
    z-index: 10000;
    transition: bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 340px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.twc-toast.show {
    bottom: 28px;
}

.twc-toast-success {
    background: var(--color-brown);
}

.twc-toast-error {
    background: var(--color-primary);
}

/* =================
   RESPONSIVE (Always Mobile Frame)
   ================= */

@media (min-width: 421px) {
    /* On desktop, enforce mobile frame with subtle border */
    body {
        padding: 20px 0;
    }
    
    body.twc-app-body,
    body.twc-login-body {
        border-radius: var(--radius-xl);
        overflow: hidden;
    }
    
    .twc-fab {
        right: calc(50% - 190px);
    }
}

/* Ensure grids never expand beyond 2 columns */
@media (min-width: 640px) {
    .twc-wine-cards-grid,
    .twc-wine-grid-compact {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .twc-admin-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .twc-wine-card:hover,
    .twc-admin-card:hover,
    .twc-btn:hover {
        transform: none;
    }
}

/* iOS safe area */
@supports (padding: max(0px)) {
    .twc-main-content {
        padding-bottom: max(100px, env(safe-area-inset-bottom));
    }
}

/* Disable text selection on buttons */
.twc-btn,
.twc-star,
.twc-admin-card,
.twc-fab,
.twc-lang-btn {
    user-select: none;
    -webkit-user-select: none;
}
