@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 24px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    text-align: center;
    margin-bottom: 24px;
}

.header-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

/* Navigation */
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-tab {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-tab.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border-bottom: 3px solid #ffecd2;
}

/* Main Content */
.main-content {
    padding: 32px 0;
    min-height: calc(100vh - 200px);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* Page Headers */
.page-header {
    text-align: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.page-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Cards and Grids */
.products-grid,
.recipes-grid,
.sales-grid,
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #8B4513;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(252, 182, 159, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #2D5A5A;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(168, 237, 234, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #8B2635;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 154, 158, 0.3);
}

.btn-icon {
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

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

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    transition: all 0.3s ease;
    color: #333;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 1);
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

/* Search */
.search-container {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.search-input {
    max-width: 400px;
    text-align: center;
}

/* Inventory Items */
.inventory-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.inventory-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.inventory-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.inventory-info p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

.inventory-stats {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 0.875rem;
}

.inventory-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inventory-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inventory-input {
    width: 80px;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.inventory-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 1);
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status-success {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
}

.status-warning {
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    color: #8B4513;
    animation: pulse 2s infinite;
}

.status-info {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 24px;
}

.modal-actions {
    padding: 0 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

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

/* Ingredients */
.ingredients-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.ingredients-container {
    margin-top: 12px;
}

.ingredient-item {
    display: grid;
    grid-template-columns: 2fr 100px 80px 40px;
    gap: 12px;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.ingredient-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.ingredient-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
}

/* Sales */
.sale-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.sale-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sale-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sale-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.sale-details h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.sale-details p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

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

/* Empty States */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    margin: 24px 0;
}

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

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-subtitle {
    color: rgba(255, 255, 255, 0.6);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 1001;
    animation: slideInRight 0.3s ease;
}

.notification.error {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #8B2635;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Focus visible for better keyboard navigation */
.btn:focus-visible,
.nav-tab:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible {
    outline: 2px solid #ffecd2;
    outline-offset: 2px;
}

/* Better scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header-title {
        font-size: 2rem;
    }
    
    .nav-tabs {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 8px;
    }
    
    .products-grid,
    .recipes-grid,
    .sales-grid,
    .history-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .ingredient-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .inventory-header,
    .sale-item {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .inventory-controls,
    .sale-actions {
        justify-content: space-between;
    }
    
    .modal {
        margin: 16px;
        max-width: none;
    }
    
    .page-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        min-height: 44px;
        font-size: 16px;
    }
    
    .form-input,
    .form-select {
        min-height: 44px;
        font-size: 16px;
    }
    
    .nav-tab {
        min-height: 44px;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 1.5rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 16px;
    }
    
    .modal-body,
    .modal-header {
        padding: 16px;
    }
    
    .modal-actions {
        padding: 0 16px 16px;
        flex-direction: column;
    }
}
/* Kauba lisamise stiilid */
.add-stock-form {
    margin-bottom: 25px;
}

.addition-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.addition-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.addition-info {
    flex: 1;
}

.addition-info h4 {
    margin-bottom: 5px;
    color: #FFE4B5;
    font-size: 1.1rem;
}

.addition-info p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 3px;
}

.addition-amount {
    background: rgba(0, 184, 148, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    color: #00b894;
    margin-right: 15px;
    min-width: 100px;
    text-align: center;
}

.addition-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 768px) {
    .addition-item {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .form-row[style*="grid-template-columns: 2fr 120px 120px 2fr 120px"] {
        grid-template-columns: 1fr !important;
    }
}