/* ========================================
   MEETING PLANNER - ENHANCED STYLESHEET
   ======================================== */

/* ========================================
   CSS VARIABLES & ROOT STYLES
   ======================================== */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --body-bg: #f5f5f5;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
}

/* ========================================
   BASE STYLES & TYPOGRAPHY
   ======================================== */
body {
    background-color: var(--body-bg);
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }

/* ========================================
   CARD COMPONENTS
   ======================================== */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    background-color: var(--card-bg);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: var(--primary-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 1.5rem;
    border-radius: 0 !important;
    font-weight: 500;
}

.card-header-light {
    background-color: var(--light-color);
    color: var(--dark-color);
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1.75rem 2rem;
}

.card-body .card-body {
    padding: 1.25rem 1.5rem;
}

.card-footer {
    background-color: rgba(0, 0, 0, 0.02);
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.card .card-title {
    margin-bottom: 1.25rem;
    color: var(--dark-color);
    font-weight: 600;
}

/* ========================================
   FORM STYLES
   ======================================== */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
    color: #495057;
}

.form-control, 
.form-select {
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    width: 100%;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--dark-color);
    background-color: #fff;
    background-clip: padding-box;
}

.form-control:focus, 
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    outline: 0;
}

/* Form elements within cards */
.card .form-group {
    margin-bottom: 1.25rem;
}

.card .form-text {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.card .invalid-feedback {
    margin-top: 0.4rem;
    font-size: 0.85rem;
}

.card .row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.card .col-12, 
.card [class*='col-'] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Form validation */
.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: var(--danger-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:invalid:focus,
.form-control.is-invalid:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

.invalid-feedback {
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--danger-color);
    display: none;
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.was-validated .form-control:invalid ~ .invalid-tooltip,
.form-control.is-invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-tooltip {
    display: block;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ========================================
   BUTTON STYLES
   ======================================== */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    text-align: center !important;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
}

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

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

/* Voting buttons specific styles */
.btn-outline-success {
    color: var(--success-color);
    border-color: var(--success-color);
    transition: all 0.3s ease-in-out;
}

.btn-outline-success:hover,
.btn-check:checked + .btn-outline-success {
    color: #fff;
    background-color: var(--success-color);
    border-color: var(--success-color);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 8px rgba(25, 135, 84, 0.3);
}

.btn-outline-warning {
    color: var(--warning-color);
    border-color: var(--warning-color);
    transition: all 0.3s ease-in-out;
}

.btn-outline-warning:hover,
.btn-check:checked + .btn-outline-warning {
    color: #000;
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
    transition: all 0.3s ease-in-out;
}

.btn-outline-danger:hover,
.btn-check:checked + .btn-outline-danger {
    color: #fff;
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* ========================================
   BUTTON GROUP STYLES
   ======================================== */
.btn-group {
    display: inline-flex;
    vertical-align: middle;
}

.btn-group .btn {
    transition: all 0.2s ease-in-out;
    position: relative;
    z-index: 1;
}

.btn-group .btn:hover {
    z-index: 2;
    transform: translateY(-1px);
}

.btn-group .btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    z-index: 1;
}

/* ========================================
   NAVBAR STYLES
   ======================================== */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 0.75rem 0;
}

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

.navbar-brand i {
    margin-right: 0.5rem;
}

.navbar .btn-group .btn {
    transition: all 0.2s ease-in-out;
    font-weight: 500;
}

.navbar .btn-group .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* ========================================
   ALERT STYLES
   ======================================== */
.alert {
    border: none;
    border-radius: 0.375rem;
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.rounded {
    border-radius: 0.375rem !important;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

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

.vh-80 {
    min-height: 80vh;
}

/* ========================================
   FOOTER STYLES
   ======================================== */
footer {
    margin-top: 3rem;
    padding: 2rem 0;
    background-color: var(--light-color);
    border-top: 1px solid #e9ecef;
}

/* ========================================
   CUSTOM SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================
   RTL (RIGHT-TO-LEFT) SUPPORT
   ======================================== */
[dir="rtl"] .bi {
    transform: scaleX(-1);
}

[dir="rtl"] .form-control, [dir="rtl"] .form-select {
    direction: rtl;
}

[dir="rtl"] .me-3 {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

[dir="rtl"] .ms-3 {
    margin-left: 1rem !important;
}

/* Button group RTL support */
[dir="rtl"] .btn-group-rtl {
    direction: ltr;
    flex-direction: row-reverse;
}

[dir="rtl"] .btn-group-rtl .btn {
    direction: rtl;
    text-align: center;
}

[dir="rtl"] .btn {
    border-radius: 0.375rem;
}

/* Button RTL border-radius fixes */
[dir="rtl"] .btn-group > .btn:first-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

[dir="rtl"] .btn-group > .btn:last-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

[dir="rtl"] .btn-group > .btn:only-child {
    border-radius: 0.375rem;
}

[dir="rtl"] .btn-group-rtl > .btn:only-child {
    border-radius: 0.25rem !important;
}

[dir="rtl"] .btn-group-rtl .btn i {
    margin-left: 0.25rem;
    margin-right: 0;
}

/* Action button RTL support */
[dir="rtl"] .action-btn {
    direction: ltr;
    text-align: center;
}

[dir="rtl"] .action-btn i {
    margin: 0 auto;
}

/* Modal footer RTL support */
[dir="rtl"] .modal-footer {
    direction: ltr;
    text-align: left;
}

/* Input group button RTL support */
[dir="rtl"] .input-group .btn {
    border-radius: 0.375rem;
}

[dir="rtl"] .input-group .btn:first-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

[dir="rtl"] .input-group .btn:last-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Table RTL support */
[dir="rtl"] .table-responsive {
    direction: rtl;
}

[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

[dir="rtl"] .table thead th:first-child,
[dir="rtl"] .table tbody td:first-child {
    text-align: right;
    border-right: 1px solid var(--border-color);
    border-left: none;
}

[dir="rtl"] .table th.border-end,
[dir="rtl"] .table td.border-end {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

[dir="rtl"] .table th:last-child,
[dir="rtl"] .table td:last-child {
    border-left: none;
}

[dir="rtl"] .table .text-center {
    text-align: center !important;
}

[dir="rtl"] .table .text-end {
    text-align: left !important;
}

[dir="rtl"] .table .text-start {
    text-align: right !important;
}

/* Card header RTL support */
[dir="rtl"] .card-header .d-flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .card-header .d-flex .d-flex {
    flex-direction: row-reverse;
}

/* Icon RTL fixes */
[dir="rtl"] .bi-check-lg,
[dir="rtl"] .bi-question-lg,
[dir="rtl"] .bi-x-lg,
[dir="rtl"] .bi-calendar3,
[dir="rtl"] .bi-clock,
[dir="rtl"] .bi-geo-alt,
[dir="rtl"] .bi-star-fill,
[dir="rtl"] .bi-info-circle,
[dir="rtl"] .bi-exclamation-triangle,
[dir="rtl"] .bi-check-circle-fill,
[dir="rtl"] .bi-send-check {
    transform: none !important;
}

[dir="rtl"] .bi-arrow-right,
[dir="rtl"] .bi-arrow-left,
[dir="rtl"] .bi-chevron-right,
[dir="rtl"] .bi-chevron-left,
[dir="rtl"] .bi-caret-right,
[dir="rtl"] .bi-caret-left {
    transform: scaleX(-1);
}

/* Progress bar RTL support */
[dir="rtl"] .progress {
    direction: ltr;
}

[dir="rtl"] .progress-bar {
    direction: ltr;
}

/* Badge RTL support */
[dir="rtl"] .badge {
    direction: ltr;
    display: inline-block;
}

/* Form validation RTL support */
[dir="rtl"] .form-control.is-invalid,
[dir="rtl"] .was-validated .form-control:invalid {
    background-position: left calc(0.375em + 0.1875rem) center;
    padding-left: calc(1.5em + 0.75rem);
    padding-right: 0.75rem;
}

/* Input group RTL support */
[dir="rtl"] .input-group > .btn-group {
    direction: ltr;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 767.98px) {
    .card {
        margin-bottom: 1rem;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }
}

/* Button group small size adjustments */


/* Mobile RTL adjustments */
@media (max-width: 575.98px) {
    [dir="rtl"] .btn-group-rtl {
        flex-direction: column;
        width: 100%;
    }
    
    [dir="rtl"] .btn-group-rtl > .btn {
        width: 100%;
        border-radius: 0.25rem !important;
        margin: 0.25rem 0;
        border: 1px solid;
    }
    
    [dir="rtl"] .btn-group-rtl > .btn:first-child {
        margin-top: 0;
    }
    
    [dir="rtl"] .btn-group-rtl > .btn:last-child {
        margin-bottom: 0;
    }
}