/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 25px 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.logo-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.logo-img:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.brand-name {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
}

.welcome-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.welcome-animation {
    margin-bottom: 25px;
}

.drink-gif {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-lg);
    border: 4px solid rgba(255, 255, 255, 0.8);
}

.welcome-card h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.welcome-card p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Drinks Section */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.drinks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.drink-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.drink-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: var(--transition);
}

.drink-card:hover::before {
    left: 100%;
}

.drink-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.drink-card.selected {
    border: 3px solid var(--primary-color);
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(99, 102, 241, 0.3);
}

.drink-image {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drink-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.drink-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    opacity: 0;
    transition: var(--transition);
}

.drink-card:hover .drink-overlay {
    opacity: 1;
}

.drink-card:hover .drink-photo {
    transform: scale(1.05);
}

.drink-icon {
    font-size: 3rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.drink-info {
    text-align: center;
    margin-bottom: 25px;
}

.drink-info h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.drink-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 15px;
}

.price-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-weight: 700;
    color: var(--primary-color);
}

.currency {
    font-size: 1.1rem;
}

.amount {
    font-size: 2rem;
}

.select-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 16px 25px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.select-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.select-btn:hover::before {
    left: 100%;
}

.select-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
}

.select-btn:active {
    transform: translateY(-1px);
}

/* Order Section */
.order-section {
    display: none;
    animation: slideInUp 0.5s ease;
}

.order-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.order-header {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.order-header i {
    color: var(--primary-color);
    font-size: 2rem;
}

.order-header h2 {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.selected-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    background: var(--bg-secondary);
    border-radius: 15px;
    margin-bottom: 25px;
}

.item-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 5px;
}

.item-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.item-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
}

.order-summary {
    border-top: 2px solid var(--border-color);
    padding-top: 20px;
    margin-bottom: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 1.1rem;
}

.summary-row.total {
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
    padding-top: 15px;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary-color);
}

.order-actions {
    display: flex;
    gap: 15px;
}

.pay-btn {
    flex: 2;
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: var(--transition);
}

.pay-btn:hover .btn-shine {
    left: 100%;
}

.pay-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.4);
}

.cancel-btn {
    flex: 1;
    background: var(--error-color);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cancel-btn:hover {
    background: #dc2626;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(239, 68, 68, 0.4);
}

/* Status Section */
.status-section {
    display: none;
    animation: slideInUp 0.5s ease;
}

.status-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 50px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-icon-container {
    position: relative;
    margin-bottom: 25px;
    display: inline-block;
}

.status-icon {
    font-size: 4rem;
    position: relative;
    z-index: 2;
}

.status-icon.success i {
    color: var(--success-color);
    animation: checkmark 0.6s ease;
}

.status-icon.error i {
    color: var(--error-color);
    animation: shake 0.6s ease;
}

.status-icon.pending i {
    color: var(--warning-color);
    animation: pulse 1.5s infinite;
}

.status-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    pointer-events: none;
}

.status-particles::before,
.status-particles::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--success-color);
    border-radius: 50%;
    animation: particle-float 2s infinite ease-in-out;
}

.status-particles::before {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.status-particles::after {
    top: 70%;
    right: 20%;
    animation-delay: 1s;
}

@keyframes particle-float {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-20px) scale(1.2);
        opacity: 0.7;
    }
}

@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.status-message {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 30px;
    line-height: 1.5;
}

.status-message.success {
    color: var(--success-color);
}

.status-message.error {
    color: var(--error-color);
}

.status-message.pending {
    color: var(--warning-color);
}

.back-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
}

/* Loading Section */
.loading-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.loading-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 50px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading-animation {
    margin-bottom: 30px;
    position: relative;
}

.loading-container {
    margin-bottom: 30px;
}

.coffee-cup {
    width: 80px;
    height: 80px;
    background: #8B4513;
    border-radius: 0 0 40px 40px;
    position: relative;
    margin: 0 auto 20px;
    box-shadow: inset 0 0 0 8px #654321;
}

.coffee-cup::before {
    content: '';
    position: absolute;
    top: 15px;
    right: -25px;
    width: 20px;
    height: 30px;
    border: 8px solid #654321;
    border-left: none;
    border-radius: 0 15px 15px 0;
}

.coffee-liquid {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    height: 50px;
    background: linear-gradient(45deg, #3E2723, #5D4037);
    border-radius: 0 0 30px 30px;
    animation: coffee-fill 2s ease-in-out infinite;
}

@keyframes coffee-fill {
    0%, 100% { height: 50px; }
    50% { height: 40px; }
}

.coffee-steam {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
}

.steam-line {
    width: 3px;
    height: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
    position: absolute;
    animation: steam-rise 1.5s ease-in-out infinite;
}

.steam-1 {
    left: -8px;
    animation-delay: 0s;
}

.steam-2 {
    left: 0px;
    animation-delay: 0.5s;
}

.steam-3 {
    left: 8px;
    animation-delay: 1s;
}

@keyframes steam-rise {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-15px) scale(0.8);
    }
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce-dots 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bounce-dots {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.loading-card h3 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.loading-card p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 15px;
    }
    
    .header {
        padding: 20px 25px;
    }
    
    .logo-container {
        gap: 15px;
    }
    
    .logo-img {
        width: 60px;
        height: 60px;
    }
    
    .brand-name {
        font-size: 2.2rem;
    }
    
    .welcome-card {
        padding: 30px 20px;
    }
    
    .welcome-card h2 {
        font-size: 1.8rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .drinks-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .drink-card {
        padding: 25px 20px;
    }
    
    .drink-image {
        height: 120px;
    }
    
    .drink-photo {
        width: 100px;
        height: 100px;
    }
    
    .drink-info h3 {
        font-size: 1.4rem;
    }
    
    .order-actions {
        flex-direction: column;
    }
    
    .order-card,
    .status-card,
    .loading-card {
        padding: 30px 20px;
    }
    
    .selected-item {
        padding: 20px;
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .item-price {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 10px;
    }
    
    .brand-name {
        font-size: 1.9rem;
    }
    
    .welcome-card h2 {
        font-size: 1.6rem;
    }
    
    .section-header h2 {
        font-size: 1.6rem;
    }
    
    .drink-card {
        padding: 20px 15px;
    }
    
    .order-header h2 {
        font-size: 1.6rem;
    }
    
    .pay-btn,
    .cancel-btn {
        padding: 16px 25px;
        font-size: 1rem;
    }
}

/* High-resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-img,
    .drink-photo,
    .drink-gif {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}