/**
 * Coffee Logger App - Enhanced Experience
 * Beautiful, modern, delightful UX
 * @version 4.0.0
 */

:root {
    --coffee-brown-900: #2c1810;
    --coffee-brown-800: #3a2a1d;
    --coffee-brown-700: #6f4e37;
    --coffee-brown-600: #8b6f47;
    --coffee-brown-500: #a67c52;
    --coffee-brown-400: #c0956a;
    --coffee-brown-300: #d4a574;
    --coffee-brown-200: #e8d4b8;
    --coffee-brown-100: #f5f1ed;
    --coffee-brown-50: #faf8f6;
    
    --gradient-warm: linear-gradient(135deg, #6f4e37 0%, #a67c52 50%, #d4a574 100%);
    --gradient-subtle: linear-gradient(180deg, #faf8f6 0%, #f5f1ed 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #faf8f6 100%);
    
    --success-gradient: linear-gradient(135deg, #4caf50 0%, #81c784 100%);
    --error-gradient: linear-gradient(135deg, #f44336 0%, #e57373 100%);
    
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-large: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(111, 78, 55, 0.15);
    --shadow-focus: 0 0 0 4px rgba(111, 78, 55, 0.12);
    
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Smooth scrolling and better font rendering */
body.app-page {
    background: var(--gradient-subtle);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced Container */
.coffee-app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    animation: fadeInUp 0.6s ease-out;
}

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

/* Today's Summary - Enhanced */
.today-summary {
    background: var(--gradient-card);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-medium);
    margin-bottom: 2rem;
    border: 1px solid rgba(111, 78, 55, 0.08);
    position: relative;
    overflow: hidden;
    animation: slideInDown 0.5s ease-out;
}

.today-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-warm);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

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

.today-summary h2 {
    margin: 0 0 1.5rem 0;
    color: #2c1810;
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.today-summary h2::before {
    content: '☕';
    font-size: 2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(111, 78, 55, 0.04);
    border-radius: 12px;
    transition: all var(--transition-base);
}

.stat-item:hover {
    transform: translateY(-2px);
    background: rgba(111, 78, 55, 0.08);
    box-shadow: var(--shadow-soft);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--coffee-brown-700);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--coffee-brown-600);
    font-weight: 500;
}

/* Quick Actions - Dramatically Enhanced */
.quick-actions {
    background: var(--gradient-card);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-medium);
    margin-bottom: 2rem;
    border: 1px solid rgba(111, 78, 55, 0.08);
    animation: fadeIn 0.6s ease-out 0.2s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.quick-actions h2 {
    margin: 0 0 1.5rem 0;
    color: var(--coffee-brown-900);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-actions h2::after {
    content: '⚡';
    font-size: 1.25rem;
}

.quick-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.quick-action-btn,
.quick-btn {
    background: linear-gradient(145deg, #ffffff 0%, #faf8f6 100%);
    border: 2px solid rgba(111, 78, 55, 0.12);
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.quick-action-btn::before,
.quick-btn::before {
    content: '☕';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 2.5rem;
    opacity: 0.1;
    transition: all var(--transition-base);
}

.quick-action-btn:hover,
.quick-btn:hover {
    border-color: var(--coffee-brown-700);
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-large), var(--shadow-glow);
}

.quick-action-btn:hover::before,
.quick-btn:hover::before {
    opacity: 0.15;
    transform: rotate(12deg) scale(1.1);
}

.quick-action-btn:active,
.quick-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.quick-coffee-name,
.quick-name {
    font-weight: 700;
    color: var(--coffee-brown-900);
    font-size: 1.125rem;
    line-height: 1.3;
}

.quick-coffee-count,
.quick-details {
    font-size: 0.875rem;
    color: var(--coffee-brown-600);
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    background: rgba(111, 78, 55, 0.1);
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
}

/* Form Container - Premium Feel */
.coffee-form-container {
    background: var(--gradient-card);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-large);
    margin-bottom: 2rem;
    position: relative;
    border: 1px solid rgba(111, 78, 55, 0.08);
    animation: fadeInScale 0.6s ease-out 0.3s both;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form-title {
    margin: 0 0 2.5rem 0;
    color: #2c1810;
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
}

.form-cancel {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(111, 78, 55, 0.06);
    border: none;
    font-size: 1.5rem;
    color: var(--coffee-brown-600);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-base);
}

.form-cancel:hover {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    transform: rotate(90deg);
}

/* Section Headers */
.section-title {
    margin: 0 0 1.5rem 0;
    color: var(--coffee-brown-900);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
}

/* Source Selection - Beautiful Cards */
.source-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.source-card {
    cursor: pointer;
    position: relative;
    transition: all var(--transition-base);
}

.source-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.card-content {
    background: linear-gradient(145deg, #ffffff 0%, #faf8f6 100%);
    border: 3px solid rgba(111, 78, 55, 0.12);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all var(--transition-base);
    pointer-events: none;
    position: relative;
    overflow: hidden;
    color: #2c1810 !important;
}

.card-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(111, 78, 55, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: all var(--transition-slow);
}

.source-card:hover .card-content {
    border-color: var(--coffee-brown-600);
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-large);
}

.source-card:hover .card-content::before {
    opacity: 1;
    transform: translate(25%, 25%);
}

.source-card input[type="radio"]:checked + .card-content,
.source-card.selected .card-content {
    background: var(--gradient-warm);
    color: white;
    border-color: var(--coffee-brown-700);
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.source-card input[type="radio"]:checked + .card-content::before {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

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

.source-card:hover .card-icon {
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-12px); }
    50% { transform: translateY(-6px); }
    75% { transform: translateY(-9px); }
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2c1810 !important;
}

.card-description {
    font-size: 1rem;
    opacity: 0.95;
    color: #6f4e37 !important;
}

/* Form Inputs - Modern Style */
.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(111, 78, 55, 0.15);
    border-radius: 12px;
    font-size: 1.0625rem;
    transition: all var(--transition-base);
    font-family: inherit;
    background: #3a3a3a;
    color: white;
}
    
.form-input::placeholder {
    color: #999;
}

.form-input:hover {
    border-color: rgba(111, 78, 55, 0.25);
}

.form-input:focus {
    outline: none;
    border-color: var(--coffee-brown-700);
    box-shadow: var(--shadow-focus);
    background: #fff;
}

/* Roaster/Store Grid */
.roaster-grid,
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.roaster-option,
.store-option {
    background: linear-gradient(145deg, #ffffff 0%, #faf8f6 100%);
    border: 2px solid rgba(111, 78, 55, 0.12);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
    color: #2c1810;
}

.roaster-option:hover,
.store-option:hover {
    border-color: var(--coffee-brown-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: var(--gradient-warm);
    color: white;
}

.roaster-option:active,
.store-option:active {
    transform: translateY(0) scale(0.97);
}

.roaster-option.selected,
.store-option.selected {
    background: var(--coffee-brown-700);
    color: white;
    border-color: var(--coffee-brown-700);
}

/* Method Grid - Interactive Icons */
.method-grid,
.drink-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 1rem;
    max-width: 700px;
    margin: 1.5rem auto;
}

.method-card,
.drink-type-option {
    cursor: pointer;
    position: relative;
}

.method-card input[type="radio"],
.drink-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.method-content,
.drink-card {
    background: linear-gradient(145deg, #ffffff 0%, #faf8f6 100%);
    border: 2px solid rgba(111, 78, 55, 0.12);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all var(--transition-base);
    pointer-events: none;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.method-card:hover .method-content,
.drink-type-option:hover .drink-card {
    border-color: var(--coffee-brown-600);
    transform: translateY(-4px) rotate(2deg);
    box-shadow: var(--shadow-medium);
}

.method-card input[type="radio"]:checked + .method-content,
.drink-type-option input[type="radio"]:checked + .drink-card {
    background: var(--gradient-warm);
    color: white;
    border-color: var(--coffee-brown-700);
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.method-icon,
.drink-icon {
    font-size: 2rem;
    display: inline-block;
    transition: all var(--transition-base);
}

.method-card:hover .method-icon,
.drink-type-option:hover .drink-icon {
    transform: scale(1.2) rotate(-10deg);
}

.method-name,
.drink-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--coffee-brown-900);
}

/* Rating System - Beautiful Interactive Stars */
.rating-options {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 2rem auto;
    max-width: 500px;
}

.rating-card {
    cursor: pointer;
    position: relative;
    flex: 1;
}

.rating-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rating-content {
    background: linear-gradient(145deg, #ffffff 0%, #faf8f6 100%);
    border: 2px solid rgba(111, 78, 55, 0.12);
    border-radius: 12px;
    padding: 1.25rem 0.5rem;
    font-size: 1.75rem;
    transition: all var(--transition-base);
    pointer-events: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
}

.rating-card:hover .rating-content {
    border-color: var(--coffee-brown-400);
    transform: translateY(-6px) scale(1.15);
    box-shadow: var(--shadow-large);
}

.rating-card input[type="radio"]:checked + .rating-content {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    border-color: #ff9800;
    transform: scale(1.12);
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
    animation: starPulse 0.6s ease-out;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1.12); }
    50% { transform: scale(1.25); }
}

/* Hover effect: show preview of rating */
.rating-options:hover .rating-card .rating-content {
    filter: grayscale(0.3);
    opacity: 0.6;
}

.rating-card:hover .rating-content,
.rating-card:hover ~ .rating-card .rating-content {
    filter: grayscale(0);
    opacity: 1;
}

/* Add Details Toggle - Progressive Disclosure */
.add-details-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 400px;
    margin: 2rem auto 0;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(145deg, #ffffff 0%, #faf8f6 100%);
    border: 2px dashed rgba(111, 78, 55, 0.2);
    border-radius: 12px;
    color: var(--coffee-brown-600);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.add-details-toggle:hover {
    border-color: var(--coffee-brown-400);
    background: linear-gradient(145deg, #faf8f6 0%, #f5f1ed 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.add-details-toggle.expanded {
    border-style: solid;
    border-color: var(--coffee-brown-400);
    background: linear-gradient(135deg, var(--coffee-brown-100) 0%, var(--coffee-brown-50) 100%);
}

.add-details-toggle .toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--coffee-brown-700);
    color: white;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    transition: transform var(--transition-fast);
}

.add-details-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

.add-details-toggle .toggle-hint {
    color: var(--coffee-brown-400);
    font-weight: 400;
    font-size: 0.85rem;
}

/* Optional Badge for Section Titles */
.optional-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(111, 78, 55, 0.08);
    color: var(--coffee-brown-500);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Details Section Animation */
.details-section {
    animation: slideDown var(--transition-base) ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Actions - Prominent Buttons */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(111, 78, 55, 0.08);
}

.btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-warm);
    color: white;
    box-shadow: var(--shadow-medium);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-large), var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(-1px) scale(1.02);
}

.btn-submit {
    position: relative;
    overflow: visible;
}

.btn-submit::after {
    content: '✓';
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    font-size: 1.5rem;
    transition: all var(--transition-bounce);
}

.btn-submit:hover::after {
    transform: translateY(-50%) scale(1);
}

.btn-secondary {
    background: white;
    color: #333;
    border: 2px solid rgba(111, 78, 55, 0.2);
}

.btn-secondary:hover {
    border-color: var(--coffee-brown-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Modals - Elegant Overlays */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal.show {
    display: flex;
    opacity: 1;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--gradient-card);
    border-radius: 24px;
    max-width: 700px;
    width: calc(100% - 2rem);
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-large);
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(111, 78, 55, 0.08);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 2px solid rgba(111, 78, 55, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(111, 78, 55, 0.02) 0%, transparent 100%);
}

.modal-header h2 {
    margin: 0;
    color: #2c1810;
    font-size: 1.75rem;
    font-weight: 700;
}

.modal-close {
    background: rgba(111, 78, 55, 0.08);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--coffee-brown-600);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(85vh - 180px);
}

/* Toast Notifications - Delightful Feedback */
.toast-container {
    position: fixed;
    top: 5rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 1.25rem 1.75rem;
    box-shadow: var(--shadow-large);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    pointer-events: all;
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 4px solid;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left-color: #4caf50;
    background: linear-gradient(135deg, #ffffff 0%, #f1f8f4 100%);
}

.toast.error {
    border-left-color: #f44336;
    background: linear-gradient(135deg, #ffffff 0%, #fef3f2 100%);
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast.success .toast-icon::before {
    content: '✓';
    display: inline-block;
    animation: checkmark 0.6s ease-out;
}

@keyframes checkmark {
    0% { transform: scale(0) rotate(-45deg); }
    50% { transform: scale(1.2) rotate(0deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.toast.error .toast-icon::before {
    content: '✕';
    display: inline-block;
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.toast-message {
    flex: 1;
    font-weight: 600;
    color: #333;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(111, 78, 55, 0.1);
    border-top-color: var(--coffee-brown-700);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Confetti Success Animation Container */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .coffee-app-container {
        padding: 1rem;
    }

    .coffee-form-container {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .form-title {
        font-size: 2rem;
    }

    .source-options {
        gap: 1rem;
    }

    .card-content {
        padding: 2rem 1.5rem;
    }

    .card-icon {
        font-size: 3rem;
    }

    .method-grid,
    .drink-type-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.875rem;
    }

    .rating-options {
        gap: 0.5rem;
    }

    .rating-content {
        font-size: 1.5rem;
        padding: 1rem 0.25rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        padding: 1.125rem 2rem;
    }

    .toast-container {
        right: 1rem;
        left: 1rem;
    }

    .toast {
        min-width: 0;
        width: 100%;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .source-card .card-content,
    .method-card .method-content,
    .rating-card .rating-content,
    .roaster-option,
    .store-option {
        padding: 1.75rem 1.5rem;
    }
    
    .btn {
        padding: 1.25rem 2.5rem;
    }
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .coffee-form-container,
    .quick-actions,
    .modal,
    .toast-container {
        box-shadow: none;
    }
    
    .form-cancel,
    .btn-secondary {
        display: none;
    }
}
