/* Mudodung Ritual Center - Mobile Responsive CSS */

/* General mobile-first approach */
:root {
    --primary-color: #6c5ce7;
    --success-color: #00b894;
    --warning-color: #fdcb6e;
    --danger-color: #d63031;
    --info-color: #0984e3;
    --light-grey: #f5f3ff;
    --border-radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #2d3436;
}

/* Mobile Container Spacing */
.container {
    padding: 0 15px;
}

.container-fluid {
    padding: 0 15px;
}

/* Responsive Typography */
h1 {
    font-size: 24px;
    margin-bottom: 16px;
}

h2 {
    font-size: 20px;
    margin-bottom: 12px;
}

h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

h4 {
    font-size: 16px;
}

/* Mobile-First Button Styles */
.btn {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

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

.btn-primary:active,
.btn-primary:hover {
    background-color: #5f3dc4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
}

.btn-outline-primary:active,
.btn-outline-primary:hover {
    background-color: var(--light-grey);
}

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

.btn-block {
    display: block;
    width: 100%;
    margin-bottom: 8px;
}

/* Card Responsive Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    background-color: var(--light-grey);
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 16px;
}

.card-body {
    padding: 16px;
}

.card-footer {
    background-color: #fafafa;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
}

/* Mobile-First Table */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 16px;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table thead {
    background-color: var(--light-grey);
}

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

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

/* Stack tables vertically on small screens */
@media (max-width: 576px) {
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }
    
    .table-responsive {
        font-size: 13px;
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #2d3436;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    background-color: white;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.form-control:disabled {
    background-color: #f5f3ff;
    color: #999;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Select Dropdown */
select.form-control {
    cursor: pointer;
}

/* Checkbox and Radio Styles */
.form-check {
    padding-left: 0;
    margin-bottom: 12px;
}

.form-check-input {
    margin-right: 8px;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    font-size: 14px;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

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

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

.badge.bg-warning {
    background-color: var(--warning-color);
    color: #000;
}

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

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

.badge.bg-secondary {
    background-color: #999;
    color: white;
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}

.col,
.col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
    flex-basis: 0;
    flex-grow: 1;
    padding: 0 8px;
    min-width: 0;
}

/* Single column layout on mobile */
.col {
    flex: 0 0 100%;
}

@media (min-width: 576px) {
    .col-sm-1 { flex: 0 0 calc(100% / 12); }
    .col-sm-2 { flex: 0 0 calc(200% / 12); }
    .col-sm-3 { flex: 0 0 25%; }
    .col-sm-4 { flex: 0 0 calc(400% / 12); }
    .col-sm-5 { flex: 0 0 calc(500% / 12); }
    .col-sm-6 { flex: 0 0 50%; }
    .col-sm-7 { flex: 0 0 calc(700% / 12); }
    .col-sm-8 { flex: 0 0 calc(800% / 12); }
    .col-sm-9 { flex: 0 0 75%; }
    .col-sm-10 { flex: 0 0 calc(1000% / 12); }
    .col-sm-11 { flex: 0 0 calc(1100% / 12); }
    .col-sm-12 { flex: 0 0 100%; }
    
    .offset-sm-1 { margin-left: calc(100% / 12); }
    .offset-sm-2 { margin-left: calc(200% / 12); }
}

@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 calc(100% / 12); }
    .col-md-2 { flex: 0 0 calc(200% / 12); }
    .col-md-3 { flex: 0 0 25%; }
    .col-md-4 { flex: 0 0 calc(400% / 12); }
    .col-md-5 { flex: 0 0 calc(500% / 12); }
    .col-md-6 { flex: 0 0 50%; }
    .col-md-8 { flex: 0 0 calc(800% / 12); }
    .col-md-9 { flex: 0 0 75%; }
    .col-md-12 { flex: 0 0 100%; }
    
    .offset-md-2 { margin-left: calc(200% / 12); }
    .offset-md-3 { margin-left: 25%; }
}

@media (min-width: 1024px) {
    .col-lg-1 { flex: 0 0 calc(100% / 12); }
    .col-lg-2 { flex: 0 0 calc(200% / 12); }
    .col-lg-3 { flex: 0 0 25%; }
    .col-lg-4 { flex: 0 0 calc(400% / 12); }
    .col-lg-6 { flex: 0 0 50%; }
    .col-lg-8 { flex: 0 0 calc(800% / 12); }
}

/* Spacing Utilities */
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }

/* Navigation/Header Styles */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 0;
    margin-bottom: 20px;
}

nav.navbar {
    background-color: var(--primary-color);
    padding: 0;
}

nav.navbar a {
    color: white;
    text-decoration: none;
    padding: 12px 16px;
    display: block;
}

nav.navbar a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Dashboard Cards */
.dashboard-card {
    padding: 20px;
    border-radius: var(--border-radius);
    color: white;
    text-align: center;
    margin-bottom: 12px;
}

.dashboard-card h5 {
    margin-bottom: 8px;
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.9;
}

.dashboard-card h3 {
    margin: 0;
    font-size: 28px;
}

.bg-primary { background-color: var(--primary-color); }
.bg-success { background-color: var(--success-color); }
.bg-warning { background-color: var(--warning-color); }
.bg-danger { background-color: var(--danger-color); }
.bg-info { background-color: var(--info-color); }
.bg-secondary { background-color: #999; }

.text-muted {
    color: #7f8c8d;
    font-size: 13px;
}

.text-end {
    text-align: right;
}

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

/* Alert Styles */
.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-info {
    background-color: #e3f2fd;
    border-left-color: var(--info-color);
    color: #01579b;
}

.alert-warning {
    background-color: #fff3e0;
    border-left-color: var(--warning-color);
    color: #e65100;
}

.alert-danger {
    background-color: #ffebee;
    border-left-color: var(--danger-color);
    color: #b71c1c;
}

.alert-success {
    background-color: #e8f5e9;
    border-left-color: var(--success-color);
    color: #1b5e20;
}

/* Pagination Mobile */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 16px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination li {
    margin: 2px;
}

.pagination a,
.pagination span {
    padding: 8px 10px;
    display: block;
    border: 1px solid #ddd;
    text-decoration: none;
    color: var(--primary-color);
    border-radius: 4px;
}

.pagination a:hover {
    background-color: var(--light-grey);
}

.pagination .active span {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Touch-friendly spacing */
@media (max-width: 576px) {
    .btn {
        padding: 14px 16px;
        font-size: 16px;
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-control {
        font-size: 16px;
        padding: 12px;
    }
    
    .row {
        margin: 0 -8px;
    }
    
    .card {
        margin-bottom: 12px;
    }
    
    h1 { font-size: 20px; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }
}

/* Landscape orientation */
@media (orientation: landscape) and (max-height: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .btn {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
        margin: 0 auto;
    }
    
    h1 { font-size: 32px; }
    h2 { font-size: 24px; }
}

/* Print Styles */
@media print {
    body {
        background-color: white;
    }
    
    .btn,
    nav,
    footer {
        display: none;
    }
    
    .card {
        page-break-inside: avoid;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .card {
        background-color: #2a2a2a;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .form-control {
        background-color: #333;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .table tbody tr:hover {
        background-color: #333;
    }
}
