/**
 * Main Frontend Styles
 * Member Registration Form, Member List, Committee List with Filters
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --theme-primary: #2563eb;
    --theme-primary-dark: #1d4ed8;
    --theme-primary-light: #3b82f6;
    --theme-secondary: #64748b;
    --theme-success: #22c55e;
    --theme-success-light: #dcfce7;
    --theme-error: #ef4444;
    --theme-error-light: #fee2e2;
    --theme-warning: #f59e0b;
    --theme-border: #e2e8f0;
    --theme-bg: #f8fafc;
    --theme-bg-white: #ffffff;
    --theme-text: #1e293b;
    --theme-text-light: #64748b;
    --theme-text-muted: #94a3b8;
    --theme-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --theme-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --theme-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --theme-radius: 8px;
    --theme-radius-lg: 12px;
    --theme-transition: all 0.2s ease-in-out;
}

/* ============================================
   GENERAL STYLES
   ============================================ */
.member-registration-wrapper,
.member-list-wrapper,
.committee-list-wrapper {
    width:100%;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ============================================
   MEMBER REGISTRATION FORM
   ============================================ */
.member-form {
    background: var(--theme-bg-white);
    padding: 40px;
    border-radius: var(--theme-radius-lg);
    box-shadow: var(--theme-shadow-md);
    max-width: 100%;
    margin: 0 auto;
}

.form-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--theme-text);
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--theme-border);
}

.form-row {
    margin-bottom: 24px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--theme-text);
    font-size: 14px;
}

.form-row label .required {
    color: var(--theme-error);
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="date"],
.form-row select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    font-size: 15px;
    color: var(--theme-text);
    background: var(--theme-bg-white);
    transition: var(--theme-transition);
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row input.error,
.form-row select.error {
    border-color: var(--theme-error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-row input:disabled,
.form-row select:disabled {
    background: var(--theme-bg);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--theme-primary);
}

/* Submit Button */
.form-submit {
    margin-top: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--theme-radius);
    cursor: pointer;
    transition: var(--theme-transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--theme-primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--theme-primary-dark);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form Messages */
.form-messages {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--theme-radius);
    display: none;
}

.form-messages.success {
    background: var(--theme-success-light);
    color: #166534;
    display: block;
}

.form-messages.error {
    background: var(--theme-error-light);
    color: #991b1b;
    display: block;
}

.form-messages p {
    margin: 0;
}

/* ============================================
   MEMBER LIST
   ============================================ */
.member-grid {
    display: grid;
    gap: 24px;
}

.member-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.member-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.member-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .member-grid.columns-4,
    .member-grid.columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .member-grid.columns-4,
    .member-grid.columns-3,
    .member-grid.columns-2 {
        grid-template-columns: 1fr;
    }
}

.member-card {
    background: var(--theme-bg-white);
    border-radius: var(--theme-radius-lg);
    box-shadow: var(--theme-shadow);
    padding: 24px;
    transition: var(--theme-transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.member-card:hover {
    box-shadow: var(--theme-shadow-lg);
    transform: translateY(-4px);
}

.member-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 16px;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 600;
}

.member-info {
    flex: 1;
}

.member-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 4px;
}

.member-occupation {
    font-size: 14px;
    color: var(--theme-primary);
    margin: 0 0 12px;
    font-weight: 500;
}

.member-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 8px;
}

.member-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--theme-text-light);
}

.member-meta svg {
    color: var(--theme-text-muted);
}

.member-location-full {
    font-size: 12px;
    color: var(--theme-text-muted);
}

/* Pagination */
.member-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.member-pagination .page-numbers {
    padding: 10px 16px;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    color: var(--theme-text);
    text-decoration: none;
    transition: var(--theme-transition);
}

.member-pagination .page-numbers:hover,
.member-pagination .page-numbers.current {
    background: var(--theme-primary);
    color: white;
    border-color: var(--theme-primary);
}

.no-members {
    text-align: center;
    padding: 60px 20px;
    color: var(--theme-text-light);
}

/* ============================================
   COMMITTEE LIST WITH FILTERS
   ============================================ */
.committee-filters {
    background: var(--theme-bg-white);
    padding: 24px;
    border-radius: var(--theme-radius-lg);
    box-shadow: var(--theme-shadow);
    margin-bottom: 32px;
}

.committee-filters h3 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--theme-text);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1024px) {
    .filter-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .filter-row {
        grid-template-columns: 1fr;
    }
}

.filter-item label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--theme-text-light);
}

.filter-item select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    font-size: 14px;
    color: var(--theme-text);
    background: var(--theme-bg-white);
    transition: var(--theme-transition);
}

.filter-item select:focus {
    outline: none;
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-item select:disabled {
    background: var(--theme-bg);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Committee Results */
.committee-results {
    position: relative;
}

.loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--theme-radius-lg);
}

.loading-spinner span {
    padding: 16px 24px;
    background: var(--theme-bg-white);
    border-radius: var(--theme-radius);
    box-shadow: var(--theme-shadow);
    font-weight: 500;
    color: var(--theme-text);
}

.committee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.committee-card {
    background: var(--theme-bg-white);
    border-radius: var(--theme-radius-lg);
    box-shadow: var(--theme-shadow);
    padding: 20px;
    display: flex;
    gap: 16px;
    transition: var(--theme-transition);
}

.committee-card:hover {
    box-shadow: var(--theme-shadow-lg);
}

.committee-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--theme-error), #f97316);
    border-radius: var(--theme-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.committee-icon svg {
    color: white;
}

.committee-info {
    flex: 1;
    min-width: 0;
}

.committee-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--theme-text);
    margin: 0 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.committee-location {
    font-size: 13px;
    color: var(--theme-text-light);
    margin: 0;
    line-height: 1.6;
}

.committee-location strong {
    color: var(--theme-text);
    font-weight: 500;
}

.committee-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.btn-view,
.btn-download {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
}

.btn-view {
    background: var(--theme-bg);
    color: var(--theme-text);
    border: 1px solid var(--theme-border);
}

.btn-view:hover {
    background: var(--theme-border);
}

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

.btn-download:hover {
    background: var(--theme-primary-dark);
}

.no-pdf {
    font-size: 12px;
    color: var(--theme-text-muted);
    font-style: italic;
}

.no-committees {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--theme-text-light);
}

.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--theme-error);
    background: var(--theme-error-light);
    border-radius: var(--theme-radius);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .member-form {
        padding: 24px;
    }

    .committee-card {
        flex-direction: column;
        align-items: flex-center;
    }

    .committee-actions {
        flex-direction: row;
        width: 100%;
    }

    .committee-actions .btn {
        flex: 1;
    }
}

/* ============================================
   2 COLUMN FORM LAYOUT (ENHANCED)
   ============================================ */

.member-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 24px;
}

/* Full width rows */
.form-section-title,
.form-row.form-submit,
#form-messages {
    grid-column: 1 / -1;
}

/* Radio group full width */
.form-row:has(.radio-group) {
    grid-column: 1 / -1;
}
.form-row input,
.form-row select {
    background: linear-gradient(#fff, #fff) padding-box,
                linear-gradient(135deg, var(--theme-primary), var(--theme-primary-light)) border-box;
    border: 1px solid transparent;
}

.form-row input::placeholder {
    color: var(--theme-text-muted);
    font-size: 14px;
}
.form-section-title {
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-light));
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--theme-radius);
    font-size: 16px;
}
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(255,255,255,0.3), transparent);
    opacity: 0;
    transition: 0.3s;
}

.btn-primary:hover::after {
    opacity: 1;
}
@media (max-width: 768px) {
    .member-form {
        grid-template-columns: 1fr;
    }
}
.required {
    font-weight: 700;
    margin-left: 4px;
}
