/* MADINA Cement Loyalty App - Custom Styles */

/* Toast animation */
.toast-notification {
    transition: transform 0.3s ease-out;
}

/* Table styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.data-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}

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

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-active {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-inactive {
    background-color: #f3f4f6;
    color: #6b7280;
}

.badge-earn {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-redeem {
    background-color: #fef3c7;
    color: #92400e;
}

/* Action buttons */
.action-btn {
    padding: 0.375rem;
    border-radius: 0.25rem;
    transition: background-color 0.15s;
}

.action-btn:hover {
    background-color: #f3f4f6;
}

.action-btn svg {
    width: 1rem;
    height: 1rem;
}

/* Modal backdrop */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Card stats */
.stat-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.25rem;
    border: 1px solid #e5e7eb;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Sidebar */
.sidebar {
    background-color: #1f2937;
    color: #fff;
    width: 240px;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar-logo {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #374151;
}

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

.nav-section {
    padding: 0.5rem 1rem;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
    margin-top: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: #d1d5db;
    text-decoration: none;
    transition: background-color 0.15s;
}

.nav-item:hover {
    background-color: #374151;
    color: #fff;
}

.nav-item.active {
    background-color: #374151;
    color: #fff;
}

.nav-item svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

/* Main content */
.main-content {
    margin-left: 240px;
    min-height: 100vh;
    background-color: #f9fafb;
}

.content-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
}

.page-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.content-body {
    padding: 1.5rem;
}

/* Form inputs */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
}

.btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

.btn-primary {
    background-color: #1e40af;
    color: white;
}

.btn-primary:hover {
    background-color: #1e3a8a;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

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

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

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

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

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

/* Search input */
.search-input {
    padding-left: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
    background-size: 1rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state svg {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: #d1d5db;
}

/* Loading spinner */
.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* POS specific styles */
.pos-product-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.pos-product-card:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.pos-cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

/* Voucher card */
.voucher-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    background: white;
    transition: all 0.15s;
}

.voucher-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.voucher-discount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #059669;
}

/* Points display */
.points-display {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e40af;
}

/* Mobile top bar */
.mobile-top-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #1f2937;
    z-index: 30;
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-menu-btn {
    display: flex;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
}

.mobile-menu-btn:hover {
    background-color: #374151;
}

.mobile-menu-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    color: white;
}

.mobile-top-bar-title {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
    margin-left: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-top-bar-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
}

.mobile-top-bar-info-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.mobile-top-bar-info-value {
    font-size: 1rem;
    font-weight: 700;
    color: #60a5fa;
}

/* Customer points badge */
.mobile-points-badge {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
}

.mobile-points-badge .label {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #bfdbfe;
    display: block;
}

.mobile-points-badge .value {
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

/* Admin stats badge */
.mobile-admin-badge {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-admin-badge svg {
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
}

.mobile-admin-badge .value {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

/* Sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-left: 200px;
    }
}

@media (max-width: 768px) {
    .mobile-top-bar {
        display: flex;
    }

    .sidebar {
        width: 280px;
        height: 100vh; /* Fallback for older browsers */
        height: 100svh; /* Small viewport height - accounts for iOS Safari address bar */
        position: fixed;
        left: 0;
        top: 0;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding-top: 56px;
    }

    .content-header {
        padding: 1rem;
    }

    .content-body {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.25rem;
    }
}
