/* Admin Styles */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --sidebar-width: 250px;
    --header-height: 70px;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f7fb;
    color: #333;
}

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header {
    margin-bottom: 2rem;
    text-align: center;
    margin-top: -0.5rem;
}

.ws-logo--login {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 2.8rem;
    color: #d4af37;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.2);
    margin-bottom: 0.8rem;
    display: inline-block;
    position: static;
}

.ws-logo--login::after {
    display: none;
}

.login-header h1 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.login-form label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.login-form input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

.btn-login {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

.btn-login i {
    margin-right: 8px;
}

.login-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #666;
}

.login-note strong {
    color: var(--primary-color);
}

.login-footer {
    margin-top: 2rem;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.login-footer a i {
    margin-right: 5px;
}

/* Admin Dashboard */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--dark-color);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ws-logo--sidebar {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 2.4rem;
    color: #d4af37;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.2);
    margin-bottom: 1rem;
    display: inline-block;
    position: static;
}

.ws-logo--sidebar::after {
    display: none;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.sidebar-header p {
    font-size: 0.8rem;
    opacity: 0.7;
}

.sidebar-nav {
    flex: 1;
    padding: 2rem 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-nav li:hover {
    background-color: rgba(255,255,255,0.1);
}

.sidebar-nav li.active {
    background-color: var(--primary-color);
    border-left: 4px solid white;
}

.sidebar-nav li i {
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
    width: 100%;
    padding: 0.8rem;
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.btn-logout:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
}

.content-header {
    height: var(--header-height);
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-header h1 {
    font-size: 1.5rem;
    color: var(--dark-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

/* Content Area */
.content-area {
    padding: 2rem;
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.stat-info p {
    color: #666;
    font-size: 0.9rem;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background-color: #f8f9fa;
}

table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid #e1e5e9;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid #e1e5e9;
    vertical-align: middle;
}

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

table img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-available {
    background-color: #d4edda;
    color: #155724;
}

.status-unavailable {
    background-color: #f8d7da;
    color: #721c24;
}

.btn-action {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 5px;
    transition: opacity 0.3s;
}

.btn-edit {
    background-color: #17a2b8;
    color: white;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
}

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

/* Forms */
.tab-content {
    display: none;
}

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

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.cake-form {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Image Upload */
.image-upload {
    position: relative;
}

.image-upload input[type="file"] {
    display: none;
}

.image-preview {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
}

.image-preview:hover {
    border-color: var(--primary-color);
}

.image-preview i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.image-preview p {
    color: #666;
}

/* Buttons */
.btn-submit {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

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

.btn-secondary {
    background-color: #6c757d;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Orders */
.orders-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 2rem;
    align-items: start;
}

.orders-form-card,
.orders-table-card {
    background: white;
    border-radius: 15px;
}

.orders-form-card {
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.orders-form-card h3 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.order-form .btn-submit {
    width: 100%;
    justify-content: center;
}

.order-items {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.order-item-row {
    display: grid;
    grid-template-columns: 1fr 90px 44px;
    gap: 0.8rem;
    align-items: center;
}

.order-item-row select,
.order-item-row input {
    padding: 0.7rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.95rem;
}

.order-item-row button {
    height: 44px;
    border: none;
    border-radius: 8px;
    background: #f8d7da;
    color: #721c24;
    cursor: pointer;
}

.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    margin-bottom: 1.2rem;
}

.order-total strong {
    color: var(--dark-color);
    font-size: 1.1rem;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-processing {
    background-color: #cce5ff;
    color: #004085;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.order-status-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* Settings */
.settings-container {
    display: grid;
    gap: 2rem;
    max-width: 800px;
}

.settings-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.settings-card h3 {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark-color);
}

.db-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .admin-dashboard {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        overflow: visible;
    }

    .sidebar-nav {
        padding: 1rem 0;
    }

    .sidebar-nav li {
        justify-content: center;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .content-header {
        padding: 0 1rem;
        position: static;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .tab-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .orders-layout {
        grid-template-columns: 1fr;
    }

    .order-item-row {
        grid-template-columns: 1fr;
    }
}
