/* 
=======================================
Floating Action Button (FAB) Styles
=======================================
*/

.action-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    transition: all 0.3s ease;
}

.action-fab.active .fab-menu {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.action-fab.active .fab-main i {
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.fab-main {
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-hover);
    transition: all 0.3s ease;
    min-height: 56px;
    min-width: 56px;
    padding: 0;
}

.fab-main:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(10, 61, 122, 0.3);
}

.fab-main:active {
    transform: scale(0.95);
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.fab-action {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    position: relative;
    min-height: 52px;
    min-width: 52px;
    padding: 0;
}

.fab-action:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1) translateX(-8px);
    box-shadow: var(--shadow-hover);
}

.fab-action:active {
    transform: scale(0.95) translateX(-8px);
}

.fab-primary {
    background: var(--gradient);
    color: white;
    border: none;
}

.fab-primary:hover {
    background: var(--gradient);
    transform: scale(1.1) translateX(-8px);
}

.fab-label {
    position: absolute;
    right: 65px;
    white-space: nowrap;
    background: var(--dark);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.fab-action:hover .fab-label {
    opacity: 1;
}

/* Mobile FAB adjustments */
@media (max-width: 576px) {
    .action-fab {
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .fab-main {
        width: 48px;
        height: 48px;
        font-size: 20px;
        min-height: 48px;
        min-width: 48px;
    }

    .fab-action {
        width: 44px;
        height: 44px;
        font-size: 16px;
        min-height: 44px;
        min-width: 44px;
    }

    .fab-label {
        display: none;
    }
}

/* 
=======================================
Reading Progress Bar
=======================================
*/

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    width: 0%;
    transition: width 0.3s ease;
}

@media (max-width: 768px) {
    .reading-progress {
        height: 3px;
    }
}

/* 
=======================================
Modal Styles
=======================================
*/

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal[aria-hidden="false"] {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content {
    background-color: white;
    padding: clamp(1.5rem, 4vw, 2rem);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    position: relative;
}

.modal-content h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.modal-body {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.modal-body h3 {
    color: var(--dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.modal-body p {
    margin-bottom: 1rem;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s ease;
    border: none;
    background: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover,
.close:focus {
    color: var(--dark);
}

.close-modal {
    margin-top: 1.5rem;
}

@media (max-width: 576px) {
    .modal-content {
        max-width: 90vw;
        padding: 1.5rem 1rem;
    }

    .close {
        right: 1rem;
        top: 1rem;
    }
}

/* 
=======================================
Cookie Consent & Modals
=======================================
*/

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    padding: 1.5rem 0;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px solid var(--border-color);
}

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

.cookie-content h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--dark);
}

.cookie-content p {
    color: var(--text);
}

.cookie-settings {
    margin: 1.5rem 0;
}

.cookie-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cookie-option input {
    margin-top: 0.25rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.cookie-option label {
    font-weight: 500;
    cursor: pointer;
    color: var(--dark);
}

.cookie-description {
    font-size: 0.9rem;
    color: var(--text);
    margin-top: 0.25rem;
}

.cookie-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    max-width: 700px;
    box-shadow: var(--shadow-xl);
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    width: 90%;
}

.modal-content h2 {
    color: var(--dark);
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: var(--text);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close:hover {
    background: var(--light-alt);
    color: var(--primary);
}

.modal-body h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.modal-body p {
    color: var(--text);
}

.modal-body strong {
    color: var(--dark);
}

.modal-body a {
    color: var(--primary);
}

.modal-body a:hover {
    color: var(--secondary);
}

/* 
=======================================
Accessibility Enhancements
=======================================
*/

/* Focus visible for keyboard navigation */
.fab-main:focus-visible,
.fab-action:focus-visible,
.close:focus-visible,
.btn:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .action-fab,
    .fab-main,
    .fab-action,
    .fab-menu,
    .reading-progress,
    .modal,
    .modal-content,
    .cookie-consent,
    .progress-fill {
        transition: none;
        animation: none;
    }

    .fab-main:hover,
    .fab-action:hover {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .fab-main,
    .fab-action,
    .modal-content,
    .cookie-consent {
        border: 2px solid currentColor;
    }

    .fab-main:hover,
    .fab-action:hover {
        transform: none;
    }
}