/**
 * Church Election Procuration System Styles
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
}

/* Header */
header {
    border-bottom: 2px solid #3498db;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

header h1 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 5px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 14px;
}

/* Delegate Information */
.delegate-info {
    background: #ecf0f1;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 30px;
}

.delegate-info h2 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.info-item {
    background: white;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
}

.info-item strong {
    color: #34495e;
    display: block;
    margin-bottom: 3px;
}

/* Count Display */
.count-info {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.count-box {
    background: white;
    padding: 15px 25px;
    border-radius: 6px;
    text-align: center;
    min-width: 120px;
    border: 2px solid #bdc3c7;
}

.count-box.success {
    border-color: #27ae60;
    background: #d5f4e6;
}

.count-box.danger {
    border-color: #e74c3c;
    background: #fadbd8;
}

.count-label {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.count-value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

/* Scope Selector */
.scope-selector {
    background: #fff;
    border: 2px solid #3498db;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 30px;
}

.scope-selector h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 10px;
}

.help-text {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 15px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-label:hover {
    background: #e9ecef;
    border-color: #3498db;
}

.radio-label input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.radio-label input[type="radio"]:checked ~ .radio-text {
    color: #3498db;
}

.radio-label:has(input:checked) {
    background: #e3f2fd;
    border-color: #3498db;
}

.radio-text {
    flex: 1;
}

.radio-text strong {
    display: block;
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 2px;
}

.radio-text small {
    display: block;
    color: #7f8c8d;
    font-size: 13px;
}

/* Add Member Form */
.add-member-form {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 30px;
}

.add-member-form h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.search-wrapper {
    position: relative;
}

.search-wrapper input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s ease;
}

.search-wrapper input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
}

.search-wrapper input[type="text"]:disabled {
    background: #ecf0f1;
    cursor: not-allowed;
}

/* Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #3498db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.search-list {
    list-style: none;
}

.search-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #ecf0f1;
    transition: background 0.2s ease;
}

.search-item:hover {
    background: #e3f2fd;
}

.search-item:last-child {
    border-bottom: none;
}

.member-info strong {
    display: block;
    color: #2c3e50;
    font-size: 15px;
    margin-bottom: 3px;
}

.member-info small {
    display: block;
    color: #7f8c8d;
    font-size: 13px;
}

.search-empty,
.search-error {
    padding: 15px;
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
}

.search-error {
    color: #e74c3c;
}

/* Selected Member */
.selected-member {
    margin-top: 10px;
}

.selected-info {
    background: #d5f4e6;
    border: 2px solid #27ae60;
    border-radius: 6px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.selected-info strong {
    color: #27ae60;
    margin-right: 10px;
}

.selected-info small {
    display: block;
    color: #2c3e50;
    font-size: 13px;
    margin-top: 3px;
}

.btn-clear {
    margin-left: auto;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
}

.btn-clear:hover {
    background: #c0392b;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Details List */
.details-list {
    margin-top: 30px;
}

.details-list h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 15px;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.details-table thead {
    background: #34495e;
    color: white;
}

.details-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.details-table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
    font-size: 14px;
}

.details-table tbody tr:hover {
    background: #f8f9fa;
}

.text-center {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
}

/* Messages/Alerts */
#message-container {
    margin-bottom: 15px;
}

.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-success {
    background: #d5f4e6;
    border: 2px solid #27ae60;
    color: #27ae60;
}

.alert-error {
    background: #fadbd8;
    border: 2px solid #e74c3c;
    color: #e74c3c;
}

.alert-warning {
    background: #ffeaa7;
    border: 2px solid #f39c12;
    color: #d68910;
}

.alert-info {
    background: #e3f2fd;
    border: 2px solid #3498db;
    color: #2980b9;
}

/* Error Box */
.error-box {
    background: #fadbd8;
    border: 2px solid #e74c3c;
    border-radius: 6px;
    padding: 30px;
    text-align: center;
}

.error-box h2 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.error-box p {
    color: #2c3e50;
    margin-bottom: 10px;
}

.error-box code {
    background: #ecf0f1;
    padding: 4px 8px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .count-info {
        flex-direction: column;
    }

    .count-box {
        width: 100%;
    }

    .details-table {
        font-size: 12px;
    }

    .details-table th,
    .details-table td {
        padding: 8px;
    }
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar Styling */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search-results::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

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