/* 
 * Society Portal CSS
 * Custom styles optimized for elderly users with a focus on readability and accessibility
 */

/* General styles1 */
body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Increase font sizes for better readability */
p, li, td, th, input, select, textarea {
    font-size: 1rem; /* 16px */
}

h1 {
    font-size: 2rem; /* 32px */
}

h2 {
    font-size: 1.75rem; /* 28px */
}

h3 {
    font-size: 1.5rem; /* 24px */
}

/* Bootstrap utility classes override */
.bg-primary {
    background-color: #3670B2 !important; /* Professional blue */
}

/* Links and buttons */
a {
    color: #3670B2; /* Professional blue */
    text-decoration: none;
    font-weight: 500;
}

a:hover, a:focus {
    text-decoration: underline;
    color: #1d4e85; /* Darker blue */
}

.btn {
    font-size: 1rem;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border-radius: 4px;
    font-weight: 500;
}

.btn-primary {
    background-color: #3670B2; /* Professional blue */
    border-color: #3670B2;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #1d4e85; /* Darker blue */
    border-color: #1d4e85;
}

/* Secondary button styling */
.btn-secondary {
    background-color: #5A6268; /* Medium gray */
    border-color: #5A6268;
    color: white;
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: #4e555b; /* Darker gray */
    border-color: #4e555b;
    color: white;
}

.btn-lg {
    font-size: 1.25rem;
    padding: 0.75rem 1.5rem;
}

/* Form styling */
.form-control {
    font-size: 1rem;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

/* Card styling */
.card {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-header {
    font-weight: bold;
    background-color: #f8f9fa; /* Light gray */
    border-bottom: 1px solid #dee2e6; /* Standard bootstrap gray border */
}

.card-body {
    padding: 1.5rem;
}

/* Navigation */
.navbar {
    padding: 0.5rem 1rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
}

.navbar-dark .navbar-nav .nav-link:hover, 
.navbar-dark .navbar-nav .nav-link:focus {
    color: #fff;
    text-decoration: none;
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.table th {
    font-weight: bold;
    background-color: #f8f9fa; /* Light gray */
    padding: 0.75rem;
    border-bottom: 2px solid #dee2e6; /* Standard bootstrap gray border */
}

.table td {
    padding: 0.75rem;
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.03);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Files section */
.file-icon {
    font-size: 2rem;
    margin-right: 0.5rem;
    color: #3670B2; /* Professional blue */
}

.file-name {
    font-weight: 500;
}

.file-meta {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Notices */
.notice-date {
    font-size: 0.9rem;
    color: #6c757d; /* Medium gray */
}

.notice-title {
    font-weight: bold;
    font-size: 1.2rem;
}

/* Polls */
.poll-option {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #f8f9fa; /* Light gray */
    border-radius: 4px;
    cursor: pointer;
}

.poll-option:hover {
    background-color: #e9ecef; /* Slightly darker gray */
}

.poll-option.selected {
    background-color: #e8eef7; /* Very light blue based on #3670B2 */
    border-color: #c6d6ea; /* Light blue border based on #3670B2 */
}

/* Membership list */
.member-card {
    margin-bottom: 1rem;
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.member-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.member-email {
    color: #3670B2; /* Professional blue */
}

.member-phone {
    color: #6c757d; /* Medium gray */
}

/* QR code */
.qr-container {
    text-align: center;
    margin: 2rem 0;
}

.qr-code {
    border: 10px solid #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

.qr-instructions {
    max-width: 500px;
    margin: 1rem auto;
    text-align: center;
    font-size: 1.1rem;
}

/* Accessibility improvements */
.high-contrast {
    background-color: #000 !important;
    color: #fff !important;
}

.high-contrast a {
    color: #6899d4 !important; /* Light blue based on #3670B2 */
}

.high-contrast .card, .high-contrast .table {
    background-color: #333 !important;
    color: #fff !important;
}

/* Accessibility toggle */
.accessibility-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #3670B2; /* Professional blue */
    color: #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Typography adjustments */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Button adjustments */
    .btn:not(.btn-sm):not(.navbar-toggler) {
        width: 100%;
        margin: 0.25rem 0;
        padding: 0.75rem 1rem;
        font-size: 1.1rem;
    }
    
    /* Card adjustments for mobile */
    .card {
        border-radius: 6px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Table adjustments */
    .table {
        font-size: 0.9rem;
    }
    
    /* Make tables scrollable horizontally on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better spacing for stacked forms */
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    /* Adjust margins for mobile */
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    /* Adjust navbar for mobile */
    .navbar-brand {
        margin-right: auto;
    }
    
    /* Improve form spacing */
    .mb-3 {
        margin-bottom: 1.25rem !important;
    }
    
    /* Make QR code responsive */
    .qr-code img {
        max-width: 100%;
        height: auto;
    }
}

/* Larger clickable areas for touch devices */
@media (max-width: 992px) {
    /* Enhance touch targets */
    .nav-link, .btn {
        padding: 0.75rem 1rem;
        min-height: 44px; /* Apple's recommended minimum touch target size */
    }
    
    /* Larger form controls for touch */
    .form-control {
        height: 50px;
        font-size: 1.1rem;
    }
    
    /* Larger checkboxes and radio buttons */
    input[type="checkbox"], input[type="radio"] {
        width: 24px;
        height: 24px;
    }
    
    /* Adjust list groups for touch */
    .list-group-item {
        padding: 0.75rem 1.25rem;
    }
    
    /* Make sure file links are easily tappable */
    .file-link {
        display: block;
        padding: 0.75rem;
        margin: 0.5rem 0;
        background-color: #f8f9fa; /* Light gray */
        border-radius: 6px;
    }
    
    /* Adjust dropdown menus for touch */
    .dropdown-item {
        padding: 0.75rem 1.5rem;
    }
}

/* Mobile-specific fixes */
@media (max-width: 576px) {
    /* Full width containers on very small screens */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Stack buttons vertically on very small screens */
    .btn-group {
        display: flex;
        flex-direction: column;
    }
    
    /* Adjust card decks for mobile */
    .card-deck {
        display: block;
    }
    
    /* Single column for membership directory on mobile */
    .member-card {
        max-width: 100%;
    }
    
    /* Ensure navbar toggle is easily tappable */
    .navbar-toggler {
        padding: 0.75rem;
        font-size: 1.1rem;
    }
    
    /* Center align headers on small screens */
    .text-center-xs {
        text-align: center !important;
    }
    
    /* Simplify tables on very small screens */
    .table-mobile-stacked th {
        display: none;
    }
    
    .table-mobile-stacked td {
        display: block;
        width: 100%;
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-top: none;
    }
    
    .table-mobile-stacked td:before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 45%;
        text-align: left;
        font-weight: bold;
    }
}