/**
 * Reusable UI Components for Public Website
 */

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: var(--color-text-tertiary);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    color: #1a1a1a !important;
    background: #ffffff !important;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a1a1a' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-select:hover {
    background-color: #f9fafb !important;
    border-color: #9ca3af;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background-color: #ffffff !important;
}

/* Option styling - black text on white background */
.form-select option {
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    color: #1a1a1a !important;
    background: #ffffff !important;
    border: none;
}

/* Ensure all select elements have black text */
select.form-select,
select.form-select option {
    color: #1a1a1a !important;
    background-color: #ffffff !important;
}

select.form-select option:hover,
select.form-select option:checked {
    background-color: #f3f4f6 !important;
    color: #1a1a1a !important;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.form-error {
    color: #ef4444;
    font-size: 13px;
    margin-top: 6px;
}

/* Alert Messages */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 15px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: #f59e0b;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--color-primary);
    color: white;
}

.badge-secondary {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

/* Card */
.card {
    background: var(--color-surface);
    backdrop-filter: blur(var(--blur-md));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

/* Audio Player */
.audio-player {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 32px 0;
}

.audio-player-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.audio-player-cover {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-bg-secondary);
}

.audio-player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.audio-player-info h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.audio-player-info p {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.audio-player-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.audio-player-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-player-btn:hover {
    background: var(--color-primary-hover);
    transform: scale(1.05);
}

.audio-player-progress {
    flex: 1;
    height: 6px;
    background: var(--color-surface);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.audio-player-progress-bar {
    height: 100%;
    background: var(--color-primary);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.audio-player-time {
    font-size: 13px;
    color: var(--color-text-secondary);
    min-width: 45px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: var(--color-text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--color-surface);
    color: var(--color-text);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 32px;
}

.tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab:hover {
    color: var(--color-text);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Page Header Section */
.page-header-section {
    padding: 0;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
}

/* Breadcrumb - Centered and Unified Style */
.breadcrumb,
.breadcrumb-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-size: 15px;
    color: var(--color-text-secondary);
    padding: 60px 0 40px;
    text-align: center;
}

.breadcrumb a,
.breadcrumb-centered a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover,
.breadcrumb-centered a:hover {
    color: var(--color-text);
}

.breadcrumb span:last-child,
.breadcrumb-centered span:last-child {
    color: var(--color-text);
    font-weight: 500;
}

.breadcrumb-separator {
    margin: 0 12px;
    color: var(--color-text-tertiary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 48px;
}

.pagination a {
    padding: 10px 18px;
    color: var(--color-text);
    text-decoration: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-primary);
}

.pagination a.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Social Share */
.social-share {
    display: flex;
    gap: 12px;
    align-items: center;
}

.social-share-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.social-share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.social-share-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.social-share-btn .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.social-share-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.loading-text {
    margin-left: 16px;
    font-size: 16px;
    color: var(--color-text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 32px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    color: var(--color-text-secondary);
    max-width: 400px;
    margin: 0 auto 32px;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow-lg);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
}

@media (max-width: 768px) {
    .card {
        padding: 24px;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab {
        white-space: nowrap;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}

/* Newsletter Modal */
.newsletter-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.newsletter-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.newsletter-modal {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.newsletter-modal-overlay.active .newsletter-modal {
    transform: translateY(0);
}

.newsletter-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--color-text-tertiary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.newsletter-modal-close:hover {
    color: var(--color-text);
}

.newsletter-modal-icon {
    width: 80px;
    height: 80px;
    background: rgba(251, 191, 36, 0.1); /* Warning color with opacity */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: var(--color-warning);
}

.newsletter-modal h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--color-text);
}

.newsletter-modal p {
    color: var(--color-text-secondary);
    margin-bottom: 32px;
    font-size: 16px;
}

.newsletter-modal-btn {
    background: linear-gradient(135deg, var(--color-warning), var(--color-warning-dark));
    color: #1a1a1a;
    border: none;
    padding: 12px 32px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.newsletter-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

