/* Moose Inventory System - Main Stylesheet */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
}

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

/* Header */
.main-header {
    background-color: #2c3e50;
    color: white;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.header-logo a {
    color: white;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
}

.main-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    background-color: #34495e;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-email {
    color: #ecf0f1;
    font-size: 14px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    min-width: 150px;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background-color: #f5f5f5;
}

/* Cards */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 16px;
    margin-bottom: 16px;
}

.card h2 {
    margin-bottom: 12px;
    color: #2c3e50;
    font-size: 1.3rem;
}

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

.card-header h2 {
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.card-header .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

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

.checkbox-label {
    display: block;
    padding: 8px 0;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
}

.checkbox-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid white;
    color: white;
}

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

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

.btn-lg {
    padding: 15px 30px;
    font-size: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tfoot {
    font-weight: bold;
    background-color: #f8f9fa;
}

/* Compact table for mobile/narrow screens */
.table-compact th,
.table-compact td {
    padding: 6px 8px;
    font-size: 14px;
    line-height: 1.3;
}

.table-compact th {
    font-size: 13px;
    padding: 8px;
}

.table-compact tbody tr {
    border-bottom: 1px solid #eee;
}

/* Reduce margin on compact tables */
.table-compact {
    margin: 10px 0;
}

/* Category row colors */
.beer-row {
    background-color: #fff8e1 !important;
}

.beer-row:hover {
    background-color: #fff3cd !important;
}

.wine-row {
    background-color: #f3e5f5 !important;
}

.wine-row:hover {
    background-color: #e1bee7 !important;
}

.liquor-row {
    background-color: #ffe0b2 !important;
}

.liquor-row:hover {
    background-color: #ffcc80 !important;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-beer {
    background-color: #ffc107;
    color: #000;
}

.badge-wine {
    background-color: #9c27b0;
    color: white;
}

.badge-liquor {
    background-color: #ff5722;
    color: white;
}

/* Messages */
.success-message,
.error-message {
    padding: 15px;
    padding-right: 40px;
    border-radius: 4px;
    margin-bottom: 20px;
    position: relative;
    animation: slideDown 0.3s ease-out;
}

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

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 24px;
    height: 24px;
    transition: opacity 0.2s;
}

.message-close:hover {
    opacity: 1;
}

/* Login/Auth Pages */
.login-box {
    max-width: 400px;
    margin: 100px auto;
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    max-width: 280px;
    width: 100%;
    height: auto;
}

.login-box h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
}

.login-box h2 {
    text-align: center;
    color: #7f8c8d;
    font-size: 18px;
    margin-bottom: 30px;
}

/* Location Selection */
.location-selection-box {
    max-width: 800px;
    margin: 50px auto;
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.location-card {
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.location-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.location-card h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.location-address {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 15px;
}

.logout-link {
    text-align: center;
    margin-top: 30px;
}

.text-link {
    color: #3498db;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.dashboard-card {
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.dashboard-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

.dashboard-card h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.dashboard-card p {
    color: #7f8c8d;
    font-size: 14px;
}

.admin-card {
    border-color: #e74c3c;
}

.admin-card:hover {
    border-color: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

.location-indicator {
    background-color: #ecf0f1;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.change-location {
    text-align: center;
    margin-top: 30px;
}

/* Category Selection */
.category-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.category-card {
    display: block;
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.beer-card {
    border-color: #ffc107;
}

.beer-card:hover {
    border-color: #ffa000;
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.3);
}

.wine-card {
    border-color: #9c27b0;
}

.wine-card:hover {
    border-color: #7b1fa2;
    box-shadow: 0 6px 16px rgba(156, 39, 176, 0.3);
}

.liquor-card {
    border-color: #ff5722;
}

.liquor-card:hover {
    border-color: #e64a19;
    box-shadow: 0 6px 16px rgba(255, 87, 34, 0.3);
}

.category-card h3 {
    margin-bottom: 10px;
    font-size: 24px;
}

/* Input Styles for Counting/Ordering */
.count-input,
.order-input,
.receive-input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 15px;
}

.count-input:focus,
.order-input:focus,
.receive-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Filter Groups */
.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-form {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.2s;
}

.modal.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #ddd;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
}

.modal-body {
    padding: 25px;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    white-space: pre-line;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    margin-left: 10px;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Modal Form Adjustments */
.modal-content h2 {
    margin-bottom: 15px;
    font-size: 20px;
}

.modal-content .form-group {
    margin-bottom: 12px;
}

.modal-content .form-group label {
    font-size: 14px;
}

.modal-content .form-group input,
.modal-content .form-group textarea,
.modal-content .form-group select {
    font-size: 14px;
    padding: 8px;
}

.modal-content .form-group small {
    font-size: 11px;
}

/* Mobile Modal Adjustments */
@media (max-width: 768px) {
    .modal-content {
        margin: 20% auto;
        max-width: 90%;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* Utilities */
.text-muted {
    color: #6c757d;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        position: relative;
    }

    .main-nav,
    .header-actions {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 10px;
        margin-top: 10px;
    }

    .main-nav.mobile-open,
    .header-actions.mobile-open {
        display: flex;
    }

    .mobile-menu-toggle {
        display: flex;
        position: relative;
        z-index: 1001;
    }

    /* Ensure proper ordering when menu is expanded */
    .header-container.menu-expanded {
        position: relative;
    }

    .header-container.menu-expanded .header-logo {
        order: 1;
        flex: 0 0 auto;
    }

    .header-container.menu-expanded .mobile-menu-toggle {
        order: 2;
        flex: 0 0 auto;
    }

    .header-container.menu-expanded .main-nav {
        order: 3;
    }

    .header-container.menu-expanded .header-actions {
        order: 4;
    }

    .container {
        padding: 10px;
    }

    .card {
        padding: 15px;
    }

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

    .table-responsive {
        font-size: 14px;
    }

    .table th,
    .table td {
        padding: 8px;
    }

    .dashboard-grid,
    .location-grid {
        grid-template-columns: 1fr;
    }

    .login-box,
    .location-selection-box {
        margin: 20px auto;
        padding: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .card-header {
        flex-wrap: nowrap;
    }

    .card-header h2 {
        white-space: normal;
        flex: 1 1 auto;
        margin-bottom: 0;
    }

    .card-header .btn {
        width: auto;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .header-logo a {
        font-size: 18px;
    }

    body {
        font-size: 14px;
    }

    .table {
        font-size: 12px;
    }

    .count-input,
    .order-input,
    .receive-input {
        width: 60px;
        padding: 6px;
        font-size: 14px;
    }
}
