/* UI Components CSS */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
    white-space: nowrap;
    min-height: 2.75rem;
}

.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button Variants */
.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-white);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #475569;
    border-color: #475569;
    color: var(--text-white);
}

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

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

.btn-outline-white {
    background-color: transparent;
    color: var(--text-white);
    border-color: var(--text-white);
}

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

.btn-success {
    background-color: var(--success-color);
    color: var(--text-white);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
    color: var(--text-white);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--text-white);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    color: var(--text-white);
}

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 2.25rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    min-height: 3.25rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Modal Components */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: 90vh;
    width: 500px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: var(--transition-fast);
    border-radius: var(--radius-sm);
}

.close-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-muted);
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 1500;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cookie-text h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.cookie-text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.cookie-buttons {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Cookie Categories */
.cookie-category {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.cookie-category:last-child {
    border-bottom: none;
}

.cookie-category h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.cookie-category p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 1;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

input:disabled + .slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Legal Pages Styles */
.legal-page {
    padding-top: 5rem;
    min-height: 100vh;
}

.legal-header {
    text-align: center;
    padding: 3rem 0;
    background-color: var(--bg-secondary);
    margin-bottom: 3rem;
}

.legal-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.last-updated {
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.legal-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.legal-section:last-child {
    border-bottom: none;
}

.legal-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.legal-section h3 {
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
    font-size: 1.25rem;
}

.legal-section h4 {
    color: var(--text-primary);
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1.125rem;
}

.legal-section ul,
.legal-section ol {
    margin-bottom: 1.5rem;
}

.legal-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.contact-details {
    background-color: var(--bg-muted);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary-color);
}

.contact-details p {
    margin-bottom: 0.75rem;
}

.contact-details p:last-child {
    margin-bottom: 0;
}

.legal-navigation {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 3rem 0;
    padding: 2rem 1rem;
    background-color: var(--bg-secondary);
}

/* Cookie Table */
.cookie-table {
    margin: 1.5rem 0;
    overflow-x: auto;
}

.cookie-table table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.cookie-table th,
.cookie-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.cookie-table th {
    background-color: var(--bg-muted);
    font-weight: 600;
    color: var(--text-primary);
}

.cookie-table td {
    color: var(--text-secondary);
}

.cookie-table tr:last-child td {
    border-bottom: none;
}

/* Thank You Page Styles */
.thank-you-section {
    padding: 6rem 0 4rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-muted) 100%);
}

.thank-you-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.thank-you-icon {
    margin-bottom: 2rem;
}

.thank-you-icon i {
    font-size: 4rem;
    color: var(--success-color);
}

.thank-you-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.thank-you-message {
    font-size: 1.125rem;
    margin-bottom: 3rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.next-steps {
    margin: 3rem 0;
}

.next-steps h2 {
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.step-card {
    background-color: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.step-icon {
    width: 3rem;
    height: 3rem;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.step-icon i {
    color: var(--text-white);
    font-size: 1.25rem;
}

.step-card h3 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.step-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

.thank-you-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.social-follow {
    margin: 3rem 0;
}

.social-follow h3 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.social-follow p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.social-follow .social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.social-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.social-link i {
    font-size: 1.125rem;
}

.newsletter-info {
    margin: 3rem 0;
    background-color: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.newsletter-info h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.info-list li:last-child {
    margin-bottom: 0;
}

.info-list i {
    color: var(--success-color);
    font-size: 1rem;
    width: 1rem;
    text-align: center;
}

/* Cookie Settings Button */
.cookie-settings-button {
    text-align: center;
    margin: 2rem 0;
}

/* Alert Components */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-color: var(--success-color);
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: var(--danger-color);
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-color: var(--warning-color);
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-color: var(--info-color);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive adjustments for components */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .cookie-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
    }
    
    .modal-content {
        width: 95vw;
        margin: 1rem;
    }
    
    .legal-navigation {
        flex-direction: column;
        align-items: center;
    }
    
    .thank-you-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .social-follow .social-links {
        flex-direction: column;
        align-items: center;
    }
    
    .cookie-table {
        font-size: 0.875rem;
    }
    
    .cookie-table th,
    .cookie-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .cookie-content {
        padding: 1rem;
    }
    
    .cookie-buttons {
        gap: 0.5rem;
    }
    
    .cookie-buttons .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}
