* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.logo {
    margin-left: 30px;
}

.login-logo {
    margin-left: 10px;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #971d35, #7e1a2e);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #971d35;
    font-size: 2rem;
    margin-bottom: 5px;
}

.login-header h2 {
    color: #666;
    font-size: 1.2rem;
    font-weight: 400;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #971d35;
}

.login-btn {
    width: 100%;
    background: #971d35;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #7e1a2e;
}

.error-message {
    color: #e74c3c;
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

/* Admin Dashboard Styles */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Hamburger style */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    position: absolute;
    top: 1.5rem;
    left: 1rem;
    z-index: 1000;
}

.hamburger span {
    height: 2px;
    width: 18px;
    background-color: #333;
    margin: 2.5px 0;
    transition: 0.3s background-color, 0.3s transform;
}

.hamburger.open span {
    background-color: white;
}

.hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}


.sidebar {
    width: 250px;
    background: #71797E;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h3 {
    margin-bottom: 5px;
}

.admin-badge {
    font-size: 12px;
    background: #971d35;
    padding: 4px 8px;
    border-radius: 4px;
}

.sidebar-nav ul {
    list-style: none;
    padding: 20px 0;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background: #34495e;
    color: white;
}

.nav-link.logout {
    color: #7e1a2e;
}

.main-content {
    margin-left: 250px;
    flex: 1;
    padding: 20px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.content-header h1 {
    color: #2c3e50;
    text-align: center;
}

.user-info {
    color: #666;
    text-align: right;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #971d35;
}

/* Form Styles */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-container h2 {
    margin-bottom: 25px;
    color: #2c3e50;
}

.product-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.product-form .form-group {
    margin-bottom: 20px;
}

.product-form select,
.product-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.product-form select:focus,
.product-form textarea:focus {
    outline: none;
    border-color: #971d35;
}

.image-preview {
    margin-top: 10px;
    max-width: 200px;
}

.image-preview img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #971d35;
    color: white;
}

.btn-primary:hover {
    background: #7e1a2e;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Products Table */
.products-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #ddd;
}

.products-table {
    overflow-x: auto;
}

.products-table table {
    width: 100%;
    border-collapse: collapse;
}

.products-table th,
.products-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.products-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}


.btn-edit,
.btn-delete {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit {
    background: #28a745;
    color: white;
}

.btn-edit:hover {
    background: #218838;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-header {
        padding-left: 60px;
        /* Leaves space for hamburger */
    }

    @media (max-width: 768px) {
        .sidebar {
            position: fixed;
            left: -250px;
            top: 0;
            height: 100%;
            width: 250px;
            background: #71797E;
            /* solid color here too */
            box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
            transition: left 0.3s ease;
            z-index: 999;
        }
    }


    .sidebar.sidebar-open {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .product-form .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .products-container .products-table .section-header {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.image-preview {
    touch-action: none;
    /* allows touch gestures like drag */
    -ms-touch-action: none;
    display: flex;
    flex-wrap: wrap;
    /* Wraps to new lines if not enough space */
    gap: 12px;
    padding: 10px 0;
    justify-content: flex-start;
    align-items: flex-start;
    overflow-x: hidden;
    /* Prevent horizontal scrollbar */
    max-width: 100%;
    box-sizing: border-box;
}

.image-wrapper {
    position: relative;
    flex: 0 0 auto;
    width: 100px;
    height: 100px;
    cursor: grab;
    border: 2px dashed transparent;
    transition: opacity 0.2s ease;
    touch-action: manipulation;
}

.image-wrapper.dragging {
    opacity: 0.5;
    border-color: #971d35;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #fff;
    color: #333;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    line-height: 18px;
}

@media (max-width: 600px) {
    .image-wrapper {
        width: 80px;
        height: 80px;
    }
}

.dragging {
    opacity: 0.6;
    transform: scale(0.98);
    z-index: 9999 !important;
}

.choices__list--multiple .choices__item {
    background-color: #7e1a2e !important;
    color: #fff !important;
    border: none !important;
    font-weight: 500;
}
.choices__list--multiple .choices__item .choices__button {
    color: #fff !important;
    opacity: 0.8;
}

.choices__list--multiple .choices__item .choices__button:hover {
    opacity: 1;
}
/* Toggle Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #4CAF50; /* Green for active */
}

input:focus + .slider {
  box-shadow: 0 0 1px #4CAF50;
}

input:checked + .slider:before {
  -webkit-transform: translateX(16px);
  -ms-transform: translateX(16px);
  transform: translateX(16px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

