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

:root {
    --primary: #16213e;
    --secondary: #0f3460;
    --accent: #e94560;
    --success: #00d9a3;
    --background: #1a1a2e;
    --surface: #252541;
    --text: #ffffff;
    --text-secondary: #b8b8d1;
    --border: #3a3a5c;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow);
    gap: 20px;
    flex-wrap: wrap;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* List Selector */
.list-selector {
    padding: 12px 16px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.list-selector:hover:not(:disabled) {
    border-color: var(--accent);
}

.list-selector:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.list-selector:focus {
    outline: none;
    border-color: var(--accent);
}

/* Buttons */
.view-btn {
    padding: 15px 30px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 140px;
}

/* Base Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-new-list {
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-new-list:hover {
    background: #d63651;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #d63651;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: #0a2847;
    transform: translateY(-1px);
}

.btn-danger {
    background: #dc3545;
    color: var(--text);
}

.btn-danger:hover {
    background: #c82333;
}

/* Main Content */
.main-content {
    min-height: 400px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--surface);
    border-radius: 12px;
    border: 2px dashed var(--border);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h2 {
    color: var(--text);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-secondary);
}

/* Counter View */
.counter-view {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
}

/* Current Total */
.current-total {
    text-align: center;
    padding: 24px;
    background: var(--background);
    border-radius: 12px;
    margin-bottom: 32px;
}

.total-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.total-amount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--success);
    margin-bottom: 16px;
    animation: pulse 0.3s ease;
}

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

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--accent));
    border-radius: 6px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Currency Section */
.currency-section {
    margin-bottom: 32px;
}

.currency-section h3 {
    margin-bottom: 16px;
    font-size: 1.2rem;
    color: var(--text);
}

.currency-grid {
    display: grid;
    gap: 12px;
}

.bills-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.coins-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.currency-item {
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}

.currency-item:hover {
    border-color: var(--accent);
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--shadow);
}

.currency-item:active {
    transform: scale(0.98);
}

.currency-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 12px;
}

.currency-count {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
}

.currency-count .count-number {
    font-weight: 700;
    color: var(--text);
    font-size: 1.3rem;
    display: inline-block;
    min-width: 30px;
}

/* Actions */
.actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.actions .btn {
    flex: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--surface);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 10px 40px var(--shadow);
    animation: modalSlideIn 0.3s ease;
}

.modal-small {
    max-width: 500px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid var(--border);
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .app {
        padding: 12px;
    }

    .header {
        flex-direction: column;
        gap: 16px;
    }

    .header h1 {
        font-size: 1.5rem;
        text-align: center;
        width: 100%;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .list-selector {
        width: 100%;
    }

    .btn-new-list {
        width: 100%;
    }

    .total-amount {
        font-size: 2.5rem;
    }

    .bills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .coins-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .actions {
        flex-direction: column;
    }

    .currency-value {
        font-size: 1.3rem;
    }

    .currency-count .count-number {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .total-amount {
        font-size: 2rem;
    }

    .currency-item {
        padding: 16px 12px;
    }

    .currency-value {
        font-size: 1.1rem;
    }

    .currency-count {
        font-size: 0.9rem;
    }

    .currency-count .count-number {
        font-size: 1rem;
    }
}
/* Login Section */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--background);
}

.login-container {
    background: var(--surface);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px var(--shadow);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.btn-block {
    width: 100%;
}

/* Currency Controls (Plus/Minus Buttons) */
.currency-controls {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.btn-control {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    background: var(--background);
    color: var(--text);
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.btn-control:hover {
    border-color: var(--accent);
    background: var(--accent);
    transform: scale(1.1);
}

.btn-control:active {
    transform: scale(0.95);
}

.btn-minus {
    border-color: #dc3545;
}

.btn-minus:hover {
    background: #dc3545;
    border-color: #dc3545;
}

.btn-plus {
    border-color: var(--success);
}

.btn-plus:hover {
    background: var(--success);
    border-color: var(--success);
}

/* Count Number Animation */
.count-number {
    transition: transform 0.2s ease;
    display: inline-block;
}

/* Responsive für Login */
@media (max-width: 480px) {
    .login-container {
        padding: 24px;
        margin: 20px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--background);
    border-radius: 8px;
    color: var(--text);
    font-weight: 600;
}

.user-icon {
    font-size: 1.2rem;
}

/* Login Hint */
.login-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 16px;
}

/* View Switcher */
.view-switcher {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
}

.btn-view {
    flex: 1;
    max-width: 200px;
    padding: 18px 30px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-view:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn-view.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

/* Currency Container */
.currency-container {
    min-height: 200px;
}

/* Responsive View Switcher */
@media (max-width: 768px) {
    .view-switcher {
        flex-direction: column;
    }
    
    .btn-view {
        max-width: 100%;
    }
    
    .user-info {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Product Search Styles
   ======================================== */

.search-container {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-container .search-input {
    flex: 1;
    min-width: 200px;
}

.search-container .btn {
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #ff69b4;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(255, 105, 180, 0.3);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
}

.product-title {
    font-size: 14px;
    font-weight: 500;
    margin: 10px 0;
    height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 24px;
    font-weight: bold;
    color: #ff69b4;
    margin: 10px 0;
}

.product-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.3s;
}

.product-btn:hover {
    opacity: 0.9;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

.empty-search {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-search-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

/* Mobile Responsive Fixes */
@media (max-width: 600px) {
    .search-container {
        flex-direction: column;
    }
    
    .search-container .search-input {
        width: 100%;
    }
    
    .search-container .btn {
        width: 100%;
    }
    
    .header-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn-new-list,
    .btn-primary,
    .btn-secondary {
        font-size: 0.9rem;
        padding: 10px 16px;
    }
}

/* Mobile Responsive Fixes */
@media (max-width: 600px) {
    .search-container {
        flex-direction: column;
    }
    
    .search-container .search-input {
        width: 100%;
    }
    
    .search-container .btn {
        width: 100%;
    }
    
    .header-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn-new-list,
    .btn-primary,
    .btn-secondary {
        font-size: 0.9rem;
        padding: 10px 16px;
    }
}
