/* Coffee Shop - Component Styles */

/* Navigation Components - Admin Pages */
.admin-navbar {
    background: var(--card-bg, #fff);
    border-bottom: 1px solid var(--border-color, #ddd);
    padding: 15px 0;
    margin-bottom: 20px;
}

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

.admin-navbar .nav-brand a {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color, #8B4513);
    text-decoration: none;
}

.admin-navbar .nav-menu {
    display: flex;
    align-items: center;
    gap: 25px;
}

.admin-navbar .nav-menu a {
    color: var(--text-color, #333);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 5px;
    transition: all 0.2s ease;
    position: relative;
}

.admin-navbar .nav-menu a:hover,
.admin-navbar .nav-menu a.active {
    color: var(--primary-color, #8B4513);
    background: var(--surface-color, #f8f9fa);
}

.admin-navbar .nav-menu a span {
    background: var(--primary-color, #8B4513);
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    min-width: 16px;
    text-align: center;
    display: inline-block;
}

.admin-navbar #auth-section {
    margin-left: 15px;
    padding-left: 15px;
    border-left: 1px solid var(--border-color, #ddd);
}

/* Mobile Menu Toggle for Admin Pages */
.admin-navbar .mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-700);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.admin-navbar .mobile-menu-toggle:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.admin-navbar .mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
    margin-top: var(--space-2);
    overflow: hidden;
    z-index: 99;
}

.admin-navbar .mobile-menu.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.admin-navbar .mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-navbar .mobile-menu li {
    border-bottom: 1px solid var(--gray-100);
}

.admin-navbar .mobile-menu li:last-child {
    border-bottom: none;
}

.admin-navbar .mobile-menu a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.admin-navbar .mobile-menu a:hover {
    background: var(--gray-50);
    color: var(--primary);
}

@media (max-width: 768px) {
    .admin-navbar .container {
        position: relative;
    }
    
    .admin-navbar .mobile-menu-toggle {
        display: block;
    }
    
    .admin-navbar .nav-menu {
        display: none;
    }
    
    .admin-navbar .mobile-menu {
        display: none;
    }
    
    .admin-navbar .mobile-menu.active {
        display: block;
    }
    
    .admin-navbar #auth-section {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
    }
}

/* Authentication Components */
.auth-form {
    margin: 2rem 0;
}

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

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

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--coffee-brown);
    box-shadow: 0 0 5px rgba(74, 44, 36, 0.3);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #666;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    font-weight: normal;
    flex: 1;
}

.btn-full {
    width: 100%;
    margin: 1rem 0;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Auth Links */
.auth-links {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.auth-links p {
    margin: 0.5rem 0;
}

.auth-links a {
    color: var(--coffee-brown);
    text-decoration: none;
    font-weight: bold;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Admin Info */
.admin-info {
    background: var(--cream);
    padding: 1rem;
    border-radius: 5px;
    margin-top: 2rem;
    border-left: 4px solid var(--accent);
}

.admin-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--coffee-brown);
}

.admin-info p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

/* Messages */
.auth-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.message {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.message-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.message-info {
    background-color: #cce7ff;
    color: #004085;
    border-left: 4px solid #007bff;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Navigation User Section */
.nav-welcome {
    color: var(--cream);
    margin-right: 1rem;
    font-weight: bold;
}

.nav-user-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Store Components */
.store-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-section {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.search-input {
    flex: 1;
    max-width: 400px;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.filter-section select {
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background: white;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.product-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--accent), var(--cream));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-roast);
    font-weight: bold;
    position: relative;
}

.product-image-placeholder.large {
    height: 300px;
    font-size: 1.2rem;
}

.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.product-modal .modal-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-price.large {
    font-size: 2rem;
    color: var(--coffee-brown);
}

.product-meta {
    font-size: 0.9rem;
    color: var(--coffee-light);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.no-products {
    text-align: center;
    padding: 3rem;
    color: var(--coffee-light);
}

.error-message {
    text-align: center;
    padding: 3rem;
    color: var(--error);
}

/* Cart Components */
.cart-section {
    max-width: 800px;
    margin: 0 auto;
}

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

.cart-items {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr 120px 100px 80px;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.item-image {
    width: 100px;
    height: 80px;
}

.item-details h3 {
    margin: 0 0 0.5rem 0;
    color: var(--coffee-brown);
    font-size: 1.1rem;
}

.item-details .item-price {
    color: var(--coffee-light);
    margin: 0;
    font-size: 0.9rem;
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
}

.item-total {
    font-weight: bold;
    color: var(--coffee-brown);
    font-size: 1.1rem;
}

.remove-item {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.empty-cart, .auth-required {
    text-align: center;
    padding: 3rem;
    color: var(--coffee-light);
}

.empty-cart h3, .auth-required h3 {
    color: var(--coffee-brown);
    margin-bottom: 1rem;
}

.cart-summary {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 2rem;
}

.summary-details {
    margin-bottom: 2rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.summary-row.total {
    border-top: 2px solid var(--accent);
    padding-top: 1rem;
    margin-top: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--coffee-brown);
}

.shipping-note {
    display: block;
    color: var(--coffee-light);
    font-style: italic;
    margin-top: 0.5rem;
}

.cart-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.cart-actions .btn {
    min-width: 150px;
}

/* Mobile responsiveness for cart */
@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .cart-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .store-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-section {
        width: 100%;
    }
    
    .auth-messages {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .nav-user-section {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    
    .product-details {
        grid-template-columns: 1fr;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

/* Product Card Components */
.product-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.product-image {
    width: 100%;
    height: 200px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-roast);
    font-size: 0.9rem;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--coffee-brown);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.product-description {
    color: var(--coffee-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex: 1;
    line-height: 1.4;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--coffee-brown);
}

.product-category {
    background: var(--cream);
    color: var(--dark-roast);
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.8rem;
    text-transform: capitalize;
}

.product-stock {
    font-size: 0.8rem;
    font-weight: bold;
}

.in-stock {
    color: var(--success);
}

.out-of-stock {
    color: var(--error);
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.product-actions .btn {
    flex: 1;
    margin: 0;
    text-align: center;
    font-size: 0.9rem;
    padding: 0.6rem;
}

/* Loading Components */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--cream);
    border-radius: 50%;
    border-top-color: var(--coffee-brown);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-left: 0.5rem;
    color: var(--coffee-light);
    font-style: italic;
}

/* Alert Components */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 5px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error);
    border-left: 4px solid var(--error);
}

.alert-warning {
    background: rgba(255, 152, 0, 0.1);
    color: var(--warning);
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    color: var(--info);
    border-left: 4px solid var(--info);
}

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

.modal.show {
    display: block;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
}

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

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--cream);
}

.modal-title {
    color: var(--coffee-brown);
    font-size: 1.3rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--coffee-light);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.modal-close:hover {
    background-color: var(--cream);
}

/* Badge Components */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 10px;
    text-transform: uppercase;
}

.badge-primary {
    background: var(--coffee-brown);
    color: white;
}

.badge-secondary {
    background: var(--accent);
    color: var(--dark-roast);
}

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

.badge-error {
    background: var(--error);
    color: white;
}

/* Input Group Components */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group input {
    border-radius: 5px 0 0 5px;
    border-right: none;
}

.input-group .btn {
    border-radius: 0 5px 5px 0;
    margin: 0;
}

.input-group-prepend,
.input-group-append {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--cream);
    border: 2px solid #ddd;
    color: var(--coffee-brown);
    font-weight: bold;
}

.input-group-prepend {
    border-right: none;
    border-radius: 5px 0 0 5px;
}

.input-group-append {
    border-left: none;
    border-radius: 0 5px 5px 0;
}

/* Pagination Components */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid var(--accent);
    color: var(--coffee-brown);
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
}

.pagination-btn:hover {
    background: var(--accent);
    color: var(--dark-roast);
}

.pagination-btn.active {
    background: var(--coffee-brown);
    color: white;
    border-color: var(--coffee-brown);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Breadcrumb Components */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.breadcrumb-item {
    color: var(--coffee-light);
}

.breadcrumb-item a {
    color: var(--coffee-brown);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--accent);
}

/* Tab Components */
.tabs {
    margin-bottom: 2rem;
}

.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--cream);
    margin-bottom: 1rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    color: var(--coffee-light);
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover,
.tab-btn.active {
    color: var(--coffee-brown);
    border-bottom-color: var(--coffee-brown);
}

.tab-content {
    display: none;
}

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

/* Card Components */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 1rem;
}

.card-header {
    padding: 1rem 1.5rem;
    background: var(--cream);
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    color: var(--coffee-brown);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--cream);
    border-top: 1px solid #ddd;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.w-full { width: 100%; }
.h-full { height: 100%; }

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
    animation: slideUp 0.5s ease-in-out;
}

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

.bounce {
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

/* Theme Toggle Styles */
.theme-toggle-container {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.theme-toggle {
    background: var(--surface-color, #f8f9fa);
    border: 2px solid var(--border-color, #ddd);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    margin-left: 15px;
}

.theme-toggle:hover {
    background: var(--primary-color, #8B4513);
    color: white;
    transform: rotate(15deg);
    border-color: var(--primary-color, #8B4513);
}

.theme-toggle:active {
    transform: rotate(15deg) scale(0.95);
}

/* Multiple Image Input Styles */
.image-input-group {
    display: flex;
    gap: var(--space-2, 8px);
    margin-bottom: var(--space-2, 8px);
    align-items: center;
}

.image-url-input {
    flex: 1;
    padding: var(--space-2, 8px);
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: var(--radius, 4px);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.image-url-input:focus {
    outline: none;
    border-color: var(--primary-color, #8B4513);
    box-shadow: 0 0 0 2px rgba(139, 69, 19, 0.1);
}

.remove-image-btn {
    padding: var(--space-2, 8px);
    background: #ef4444;
    color: white;
    border: none;
    border-radius: var(--radius, 4px);
    cursor: pointer;
    font-size: 0.8rem;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.remove-image-btn:hover {
    background: #dc2626;
}

.remove-image-btn i {
    font-size: 0.7rem;
}