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

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --bg-color: #ecf0f1;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

h1, h2, h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
}

h1 {
    text-align: center;
    font-size: 2.5em;
    font-weight: 700;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Masa Seçim Ekranı */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.table-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.table-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.table-card:hover::before {
    opacity: 1;
}

.table-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.table-card.has-orders {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.table-card h3 {
    color: white;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.table-card .order-count {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Butonlar */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn:active {
    transform: translateY(0);
}

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

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

.btn-success {
    background: var(--success-color);
    color: white;
}

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

.btn-warning {
    background: var(--warning-color);
    color: white;
}

/* Sections */
.section {
    margin-bottom: 30px;
}

.section.hidden {
    display: none;
}

.input-field {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Menü */
.menu-categories {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.category {
    background: var(--bg-color);
    padding: 20px;
    border-radius: var(--border-radius);
}

.category h4 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.menu-items {
    display: grid;
    gap: 10px;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.menu-item:hover {
    border-color: var(--primary-color);
}

.menu-item.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.menu-item-info {
    flex: 1;
}

.menu-item-name {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.menu-item-price {
    font-weight: 700;
    color: var(--success-color);
}

.menu-item.selected .menu-item-price {
    color: white;
}

/* Quantity Controls */
.menu-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-quantity {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add {
    background: var(--success-color);
    color: white;
}

.btn-add:hover {
    background: #229954;
    transform: scale(1.1);
}

.btn-plus {
    background: white;
    color: var(--primary-color);
    border: 2px solid white;
}

.btn-plus:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

.btn-minus {
    background: white;
    color: var(--danger-color);
    border: 2px solid white;
}

.btn-minus:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

.quantity-display {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1em;
}

/* Siparişler */
.orders-list {
    margin-bottom: 20px;
}

.order-group {
    background: var(--bg-color);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}

.order-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.order-group-name {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--secondary-color);
}

.payment-status {
    display: flex;
    gap: 10px;
    align-items: center;
}

.payment-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.payment-badge.paid {
    background: var(--success-color);
    color: white;
}

.payment-badge.unpaid {
    background: var(--danger-color);
    color: white;
}

.order-items-list {
    margin-bottom: 15px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
}

.order-item-name {
    font-weight: 500;
}

.order-item-price {
    font-weight: 700;
    color: var(--success-color);
}

.order-group-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 2px solid #ddd;
}

.order-total {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--secondary-color);
}

/* Total Section */
.total-section {
    background: var(--secondary-color);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.total-info {
    text-align: center;
}

.total-info p {
    font-size: 1.5em;
}

.total-info strong {
    font-size: 1.3em;
    color: var(--warning-color);
}

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

    h1 {
        font-size: 2em;
    }

    .tables-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .order-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

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

/* Login Ekranı */
.login-container {
    max-width: 400px;
    margin: 50px auto;
}

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

.error-message {
    color: var(--danger-color);
    text-align: center;
    font-weight: 600;
    padding: 10px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
}

/* Menü Düzenleme */
.menu-edit-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.edit-category {
    background: var(--bg-color);
    padding: 20px;
    border-radius: var(--border-radius);
}

.edit-category-header {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.edit-category-header input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
}

.edit-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.edit-item {
    display: flex;
    gap: 10px;
    align-items: center;
    background: white;
    padding: 10px;
    border-radius: 8px;
}

.edit-item input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
}

.edit-item input:first-child {
    flex: 2;
}

.edit-item input:last-of-type {
    flex: 1;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-icon {
    padding: 8px 12px;
    min-width: 36px;
}

/* Cache Temizle Butonu */
.cache-clear-btn {
    margin-top: 15px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #95a5a6;
    font-size: 0.9em;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    text-align: center;
}

.cache-clear-btn:hover {
    background: rgba(149, 165, 166, 0.1);
    color: #7f8c8d;
    transform: translateY(-1px);
}
