/* Terms of Service Modal Styles */

.terms-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.terms-modal.is-open {
    display: flex;
    opacity: 1;
}

.terms-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.terms-modal__content {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.terms-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid var(--primary-light);
    background: var(--gradient-primary);
}

.terms-modal__title {
    font-family: var(--heading-font);
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.terms-modal__close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--white);
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terms-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.terms-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: var(--white);
    color: var(--bg-dark);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.terms-content {
    max-width: none;
}

.terms-intro {
    font-size: 16px;
    color: var(--bg-dark);
    margin-bottom: 32px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(181, 168, 176, 0.05) 0%, rgba(212, 201, 208, 0.05) 100%);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.terms-section {
    margin-bottom: 32px;
}

.terms-section h3 {
    font-family: var(--heading-font);
    font-size: 18px;
    font-weight: 600;
    color: var(--bg-dark);
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.terms-section p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--bg-dark);
    margin-bottom: 12px;
}

.terms-section ul {
    margin: 16px 0;
    padding-left: 24px;
}

.terms-section li {
    font-size: 15px;
    line-height: 1.6;
    color: var(--bg-dark);
    margin-bottom: 8px;
    position: relative;
}

.terms-section li::marker {
    color: var(--primary-color);
}

/* Links in terms content */
.terms-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    padding: 2px 4px;
    border-radius: 4px;
    position: relative;
    display: inline-block;
}

.terms-content a:hover {
    border-bottom-color: var(--primary-color);
    color: var(--primary-dark);
    background: rgba(181, 168, 176, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(181, 168, 176, 0.2);
}

.terms-content a:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(181, 168, 176, 0.1);
}

.terms-content a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.terms-content a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.terms-content a:hover::after {
    width: 100%;
}

.terms-footer {
    margin-top: 40px;
    padding: 24px;
    background: rgba(181, 168, 176, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(181, 168, 176, 0.1);
}

.terms-footer p {
    font-size: 14px;
    color: var(--bg-dark);
    margin-bottom: 8px;
}

.terms-links {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(181, 168, 176, 0.2);
}

.terms-links ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.terms-links li {
    margin-bottom: 4px;
    font-size: 14px;
}

.terms-links li a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    padding: 2px 4px;
    border-radius: 4px;
    position: relative;
    display: inline-block;
}

.terms-links li a:hover {
    border-bottom-color: var(--primary-color);
    background: rgba(181, 168, 176, 0.1);
    color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(181, 168, 176, 0.2);
}

.terms-links li a:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(181, 168, 176, 0.1);
}

.terms-links li a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.terms-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.terms-links li a:hover::after {
    width: 100%;
}

.terms-modal__footer {
    padding: 24px 32px;
    border-top: 1px solid rgba(181, 168, 176, 0.2);
    background: #f8f9fa;
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    align-items: center;
}

.terms-modal__footer .btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.terms-modal__footer .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.terms-modal__footer .btn:hover::before {
    left: 100%;
}

.terms-modal__footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.terms-modal__footer .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Terms Banner Styles */
.terms-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 3px solid var(--primary-color);
    box-shadow: 0 -4px 20px var(--shadow-strong);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.terms-banner.is-visible {
    transform: translateY(0);
}

.terms-banner__content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: var(--gradient-primary);
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--primary-light);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.terms-banner__text {
    flex: 1;
    font-size: 14px;
    color: var(--bg-dark);
    line-height: 1.6;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.terms-banner__link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    transition: all 0.3s ease;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(181, 168, 176, 0.1);
    position: relative;
    display: inline-block;
}

.terms-banner__link:hover {
    background: var(--primary-color);
    color: var(--white);
    border-bottom-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(181, 168, 176, 0.3);
}

.terms-banner__link:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(181, 168, 176, 0.2);
}

.terms-banner__link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.terms-banner__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--white);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.terms-banner__link:hover::after {
    width: 100%;
}

.terms-banner__actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.btn--small {
    padding: 8px 16px;
    font-size: 14px;
    min-width: auto;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn--small.btn--outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    font-weight: 600;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.btn--small.btn--outline:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn--small.btn--outline:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
}

.btn--small.btn--primary {
    background: var(--primary-color);
    color: var(--white);
    border: 2px solid var(--primary-color);
    font-weight: 600;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.btn--small.btn--primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn--small.btn--primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .terms-modal__overlay {
        padding: 16px;
    }
    
    .terms-modal__content {
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .terms-modal__header {
        padding: 20px 24px;
    }
    
    .terms-modal__title {
        font-size: 20px;
    }
    
    .terms-modal__body {
        padding: 24px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    .terms-modal__footer {
        padding: 20px 24px;
        flex-direction: column;
        gap: 12px;
    }
    
    .terms-modal__footer .btn {
        width: 100%;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }
    
    .terms-modal__footer .btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
    }
    
    .terms-modal__footer .btn:hover::before {
        left: 100%;
    }
    
    .terms-modal__footer .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .terms-modal__footer .btn:active {
        transform: translateY(0);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }
    
    .terms-banner__content {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px 20px;
    }
    
    .terms-banner__text {
        text-align: center;
    }
    
    .terms-banner__actions {
        justify-content: center;
    }
    
    .terms-banner__actions .btn {
        flex: 1;
        max-width: 120px;
    }
}

@media (max-width: 480px) {
    .terms-modal__overlay {
        padding: 12px;
    }
    
    .terms-modal__header {
        padding: 16px 20px;
    }
    
    .terms-modal__body {
        padding: 20px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    .terms-modal__footer {
        padding: 16px 20px;
    }
    
    .terms-banner__content {
        padding: 12px 16px;
    }
    
    .terms-banner__text {
        font-size: 13px;
    }
}

/* Scrollbar Styling for Terms Content */
.terms-modal__body::-webkit-scrollbar {
    width: 8px;
}

.terms-modal__body::-webkit-scrollbar-track {
    background: rgba(181, 168, 176, 0.1);
    border-radius: 4px;
    margin: 4px 0;
}

.terms-modal__body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.terms-modal__body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.terms-modal__body::-webkit-scrollbar-thumb:active {
    background: var(--primary-dark);
}

/* Firefox scrollbar styling */
.terms-modal__body {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(181, 168, 176, 0.1);
}

/* Focus styles for accessibility */
.terms-modal__close:focus,
.terms-banner__link:focus,
#accept-terms:focus,
#decline-terms:focus,
#accept-banner:focus,
#decline-banner:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Animation for banner slide up */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.terms-banner.slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Document Links Styling - Simple */
.terms-link-inline {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    padding: 2px 4px;
    border-radius: 4px;
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.terms-link-inline:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}
