/* Complete Food Ordering System Design - All Pages */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    padding: 20px 0;
}

/* Container Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-top: 20px;
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease-out;
}

/* For pages without container class */
body > h2:first-child,
body > table:first-of-type,
body > form:first-child {
    max-width: 1200px;
    margin: 20px auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* Typography */
h2 {
    color: #2c3e50;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

h3 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

/* Navigation Links */
p a, body > p a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 5px 10px 5px 0;
    border: 2px solid #667eea;
    background: transparent;
}

p a:hover, body > p a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Special styling for cart and logout links */
a[href*="cart.php"], a[href*="logout.php"], a[href*="orders.php"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border: none;
    text-decoration: none;
}

a[href*="logout.php"] {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* Admin Dashboard Menu */
.admin-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    list-style: none;
    margin: 40px 0;
}

.admin-menu li {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    transform: translateY(0);
}

.admin-menu li:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4);
}

.admin-menu a {
    display: block;
    padding: 30px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.admin-menu a::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: left 0.5s;
}

.admin-menu a:hover::before {
    left: 100%;
}

/* Grid Layout for Food Items */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Food Item Cards */
.card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.card:hover {
    transform: translateY(-15px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 4px solid #667eea;
}

.card h3 {
    padding: 25px 25px 15px;
    color: #2c3e50;
    font-size: 1.5rem;
    border-bottom: 2px solid #ecf0f1;
    margin-bottom: 20px;
}

.card p {
    padding: 0 25px;
    color: #7f8c8d;
    margin-bottom: 25px;
    line-height: 1.7;
    font-size: 1rem;
}

/* Form Styles */
.inline-form {
    padding: 0 25px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Input Styles */
input[type="number"] {
    width: 80px;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="text"], input[type="hidden"] + input[type="text"] {
    padding: 12px 18px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    min-width: 150px;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Select Dropdown Styles */
select {
    padding: 12px 18px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    background: white;
    font-size: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 150px;
}

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

/* Button Styles */
button, input[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
    min-width: 120px;
}

button:hover, input[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

button:active, input[type="submit"]:active {
    transform: translateY(-1px);
}

/* Special Button Colors */
button[name="update"] {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.3);
}

button[name="checkout"] {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    box-shadow: 0 5px 20px rgba(39, 174, 96, 0.3);
    padding: 18px 35px;
    font-size: 18px;
    margin: 25px 0;
    width: 100%;
    max-width: 350px;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    margin: 25px 0;
}

/* Table without container */
body > table {
    max-width: 1200px;
    margin: 25px auto;
}

th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 18px;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
}

td {
    padding: 18px;
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.3s ease;
    vertical-align: top;
}

tr:hover td {
    background-color: rgba(102, 126, 234, 0.05);
}

tr:last-child td {
    border-bottom: none;
}

/* Data Table Specific */
.data-table th:first-child {
    border-top-left-radius: 15px;
}

.data-table th:last-child {
    border-top-right-radius: 15px;
}

/* Cart Total Row */
.data-table tr:last-child td {
    background: #f8f9fa;
    font-weight: bold;
    font-size: 1.2rem;
    color: #27ae60;
}

/* Price Display */
td:contains("₹"), td:nth-child(3), td:nth-child(4) {
    font-weight: 600;
    color: #27ae60;
    font-size: 1.1rem;
}

/* Remove Link Styling */
a[href*="remove"] {
    color: #e74c3c;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    border: 2px solid #e74c3c;
    display: inline-block;
}

a[href*="remove"]:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px);
}

/* Form in Table Cells */
td form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Order Status Styling */
td:nth-child(3) {
    font-weight: bold;
}

/* Status Color Coding */
td[contains="Pending"] { color: #f39c12; }
td[contains="Processing"] { color: #3498db; }
td[contains="Out for Delivery"] { color: #9b59b6; }
td[contains="Delivered"] { color: #27ae60; }

/* Checkout Form */
form[method="POST"][action="checkout.php"] {
    text-align: center;
    margin: 30px 0;
}

/* Order Success Message */
body:contains("Order placed successfully") {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 10px;
    margin: 20px;
    font-weight: 600;
    font-size: 1.2rem;
}

/* Empty Cart Message */
p:contains("Cart is empty") {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.3rem;
    padding: 50px;
    background: #f8f9fa;
    border-radius: 15px;
    margin: 30px 0;
    border: 2px dashed #bdc3c7;
}

/* Continue Shopping Link */
p:contains("Continue Shopping") {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    text-align: center;
}

/* Orders Page Styling */
h2:contains("My Orders") {
    color: #2c3e50;
}

h2:contains("Manage Orders") {
    color: #8e44ad;
}

/* View Orders Admin Page */
body > h2 + table {
    margin-top: 30px;
}

/* Track Orders Link */
a[href*="orders.php"] {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin: 15px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px 0;
    }
    
    .container, body > h2:first-child, body > table:first-of-type, body > form:first-child {
        margin: 10px;
        padding: 20px;
        border-radius: 15px;
    }
    
    h2 {
        font-size: 2rem;
        margin-bottom: 25px;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .admin-menu {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card h3 {
        font-size: 1.3rem;
        padding: 20px 20px 12px;
    }
    
    .card p {
        padding: 0 20px;
        margin-bottom: 20px;
    }
    
    .inline-form {
        padding: 0 20px 20px;
        justify-content: center;
    }
    
    table {
        font-size: 14px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    th, td {
        padding: 12px 10px;
        min-width: 120px;
    }
    
    td form {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        min-width: 200px;
    }
    
    td form input,
    td form select,
    td form button {
        width: 100%;
        margin: 2px 0;
    }
    
    button, input[type="submit"] {
        padding: 12px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container, body > h2:first-child, body > table:first-of-type, body > form:first-child {
        margin: 5px;
        padding: 15px;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .card h3 {
        font-size: 1.2rem;
    }
    
    th, td {
        padding: 10px 8px;
        font-size: 12px;
        min-width: 100px;
    }
    
    button, input[type="submit"] {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    input[type="text"], input[type="number"], select {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    p a, body > p a {
        padding: 8px 15px;
        margin: 3px 5px 3px 0;
        font-size: 14px;
    }
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success/Error Messages */
.success-message {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 18px 25px;
    border-radius: 12px;
    margin: 25px 0;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
    font-size: 1.1rem;
}

.error-message {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 18px 25px;
    border-radius: 12px;
    margin: 25px 0;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
    font-size: 1.1rem;
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .container {
        box-shadow: none;
        background: white;
    }
    
    button, a[href*="remove"] {
        display: none;
    }
}