/* Main Styles */
:root {
    --primary-color: #5e6eb3;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --mobile-nav-height: 60px;
    --mobile-card-padding: 1rem;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    padding-bottom: 60px; /* For footer */
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Custom navbar styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-logo {
    background-color: white;
    border-radius: 50%;
}

/* Mobile-specific navbar adjustments */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-logo {
        display: none; /* Hide logo on mobile to save space */
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .navbar-nav .text-light {
        font-size: 0.8rem;
        padding: 0.25rem 0.75rem;
    }
}

/* Card styles */
.card {
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header {
    font-weight: 600;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Mobile card adjustments */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
        border-radius: 0.75rem;
    }
    
    .card-body {
        padding: var(--mobile-card-padding);
    }
    
    .card-header {
        padding: 0.75rem var(--mobile-card-padding);
        font-size: 1rem;
    }
}

/* Form styles */
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0c1335;
    border-color: #735dfb;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}

/* Mobile button adjustments */
@media (max-width: 768px) {
    .btn {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 0.5rem;
    }
    
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .btn-lg {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
}

/* Table styles */
.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
}

/* Mobile table adjustments */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 0.5rem;
        overflow: hidden;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
    }
    
    .table th {
        font-size: 0.8rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    /* Stack table on mobile for better readability */
    .table-stack-mobile {
        display: block;
    }
    
    .table-stack-mobile thead {
        display: none;
    }
    
    .table-stack-mobile tbody,
    .table-stack-mobile tr,
    .table-stack-mobile td {
        display: block;
        width: 100%;
    }
    
    .table-stack-mobile tr {
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        margin-bottom: 1rem;
        padding: 1rem;
        background: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .table-stack-mobile td {
        border: none;
        padding: 0.5rem 0;
        position: relative;
        padding-left: 40%;
    }
    
    .table-stack-mobile td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 35%;
        font-weight: 600;
        color: var(--primary-color);
        font-size: 0.8rem;
        text-transform: uppercase;
    }
}

/* Dashboard cards */
.card .display-4 {
    font-size: 2.5rem;
    font-weight: 500;
}

/* Mobile dashboard adjustments */
@media (max-width: 768px) {
    .card .display-4 {
        font-size: 2rem;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    /* Mobile dashboard grid */
    .dashboard-stats {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .dashboard-stats .card {
        margin-bottom: 0;
    }
    
    .dashboard-stats .card-body {
        padding: 1.5rem 1rem;
        text-align: center;
    }
    
    .dashboard-stats .display-4 {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }
    
    .dashboard-stats .card-title {
        font-size: 1rem;
        margin-bottom: 0;
    }
    
    /* Mobile action buttons */
    .dashboard-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .dashboard-actions .btn {
        padding: 1.25rem 1rem;
        font-size: 1.1rem;
        border-radius: 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
}

/* Desktop dashboard layout */
@media (min-width: 769px) {
    .dashboard-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .dashboard-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card .display-4 {
        font-size: 2rem;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    /* Mobile container adjustments */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Mobile spacing adjustments */
    .mt-4 {
        margin-top: 1.5rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    .py-3 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

/* Footer styles */
.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    z-index: 1000;
}

@media (max-width: 768px) {
    .footer {
        padding: 0.75rem 0;
        font-size: 0.875rem;
    }
    
    body {
        padding-bottom: 80px; /* More space for mobile footer */
    }
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

@media (max-width: 768px) {
    .badge {
        font-size: 0.75rem;
        padding: 0.25em 0.5em;
    }
}

/* Alerts */
.alert {
    border-radius: 0.5rem;
}

@media (max-width: 768px) {
    .alert {
        margin-bottom: 1rem;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .breadcrumb {
        padding: 0.5rem 0;
        margin-bottom: 0.75rem;
        font-size: 0.875rem;
    }
}

/* Payment page specific styles */
#card-details, #saved-payment-methods, #custom-address {
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .payment-form {
        padding: 1rem;
    }
    
    .payment-form .form-group {
        margin-bottom: 1.5rem;
    }
}

/* Profile page specific styles */
.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
    display: block;
    border: 5px solid #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .profile-img {
        width: 100px;
        height: 100px;
        border-width: 3px;
    }
    
    .profile-info {
        text-align: center;
        margin-top: 1rem;
    }
    
    .profile-info h4 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
}

/* Login page mobile adjustments */
@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-container .card {
        border-radius: 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .login-container .card-body {
        padding: 2rem 1.5rem;
    }
    
    .login-container .form-label {
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    
    .login-container .form-control {
        padding: 0.875rem 1rem;
        border-radius: 0.5rem;
        font-size: 1rem;
    }
    
    .login-container .btn {
        padding: 1rem;
        font-size: 1.1rem;
        font-weight: 600;
        border-radius: 0.5rem;
    }
}

/* Mobile-specific utility classes */
@media (max-width: 768px) {
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-mb-2 {
        margin-bottom: 0.75rem !important;
    }
    
    .mobile-p-2 {
        padding: 0.75rem !important;
    }
    
    .mobile-hide {
        display: none !important;
    }
    
    .mobile-show {
        display: block !important;
    }
}

/* Mobile navigation improvements */
@media (max-width: 768px) {
    .navbar-collapse {
        background-color: var(--primary-color);
        border-radius: 0.5rem;
        margin-top: 0.5rem;
        padding: 1rem;
    }
    
    .navbar-nav .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .nav-item:last-child {
        border-bottom: none;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 0;
        font-weight: 500;
    }
}

/* Mobile form improvements */
@media (max-width: 768px) {
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem 1rem;
        border-radius: 0.5rem;
    }
    
    .form-label {
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: var(--dark-color);
    }
    
    .form-text {
        font-size: 0.8rem;
        margin-top: 0.25rem;
    }
}

/* Mobile modal improvements */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .modal-content {
        border-radius: 1rem;
    }
    
    .modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .modal-body {
        padding: 1rem 1.5rem;
    }
    
    .modal-footer {
        padding: 1rem 1.5rem 1.5rem;
    }
}

/* Mobile loading states */
@media (max-width: 768px) {
    .loading-spinner {
        width: 2rem;
        height: 2rem;
    }
    
    .btn:disabled {
        opacity: 0.6;
    }
}

/* Mobile accessibility improvements */
@media (max-width: 768px) {
    /* Ensure touch targets are at least 44px */
    .btn,
    .nav-link,
    .form-control,
    .form-select {
        min-height: 44px;
    }
    
    /* Improve focus states for touch devices */
    .btn:focus,
    .form-control:focus,
    .form-select:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Responsive fixes */
@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }
    
    h4.mb-0 {
        font-size: 1.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}