/**
 * Popup Styles for Legal Terms and Conditions Popup
 * Version: 0.0.8
 */

/* Overlay */
.ltcp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: ltcp-fade-in 0.3s ease-out;
}

@keyframes ltcp-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Popup Container */
.ltcp-popup {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: ltcp-slide-up 0.3s ease-out;
    position: relative;
}

/* Close Button */
.ltcp-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.ltcp-close-button:hover {
    background: #f0f0f0;
    color: #333;
}

.ltcp-close-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.ltcp-close-button svg {
    width: 24px;
    height: 24px;
}

@keyframes ltcp-slide-up {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Popup Header */
.ltcp-popup-header {
    padding: 25px 60px 25px 30px;
    border-bottom: 2px solid #f0f0f0;
    flex-shrink: 0;
}

.ltcp-popup-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

.ltcp-popup-header .ltcp-version {
    display: inline-block;
    margin-left: 10px;
    font-size: 14px;
    color: #666;
    font-weight: 400;
}

.ltcp-popup-header .ltcp-required {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    color: #dc3232;
    font-weight: 500;
}

/* Popup Content */
.ltcp-popup-content {
    padding: 30px;
    padding-bottom: 60px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.8;
    color: #444;
    font-size: 15px;
    position: relative;
}

.ltcp-popup-content::-webkit-scrollbar {
    width: 10px;
}

.ltcp-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.ltcp-popup-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.ltcp-popup-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.ltcp-popup-content h1,
.ltcp-popup-content h2,
.ltcp-popup-content h3,
.ltcp-popup-content h4 {
    margin-top: 25px;
    margin-bottom: 15px;
    color: #222;
}

.ltcp-popup-content h1 {
    font-size: 22px;
}

.ltcp-popup-content h2 {
    font-size: 20px;
}

.ltcp-popup-content h3 {
    font-size: 18px;
}

.ltcp-popup-content p {
    margin-bottom: 15px;
}

.ltcp-popup-content ul,
.ltcp-popup-content ol {
    margin-bottom: 15px;
    padding-left: 30px;
}

.ltcp-popup-content li {
    margin-bottom: 8px;
}

.ltcp-popup-content a {
    color: #0073aa;
    text-decoration: underline;
}

.ltcp-popup-content a:hover {
    color: #005a87;
}

/* Scroll Indicator */
.ltcp-scroll-indicator {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    background: rgba(0, 115, 170, 0.95);
    color: #fff;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    animation: ltcp-bounce 2s infinite;
    display: none;
    z-index: 10;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.ltcp-scroll-indicator.show {
    display: block;
}

@keyframes ltcp-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Popup Footer */
.ltcp-popup-footer {
    padding: 20px 30px;
    border-top: 2px solid #f0f0f0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ltcp-checkbox-container {
    margin-bottom: 0;
}

.ltcp-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
}

.ltcp-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.ltcp-checkbox-label span {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
}

.ltcp-checkbox-label input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ltcp-checkbox-label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Accept Button */
.ltcp-accept-button {
    align-self: flex-end;
    padding: 15px 30px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.ltcp-accept-button:hover:not(:disabled) {
    background: #005a87;
}

.ltcp-accept-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.ltcp-accept-button.loading {
    position: relative;
    color: transparent;
}

.ltcp-accept-button.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: ltcp-spin 0.8s linear infinite;
}

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

/* Error Message */
.ltcp-error-message {
    background: #fef0f0;
    border: 1px solid #dc3232;
    color: #dc3232;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
    order: -1;
}

.ltcp-error-message.show {
    display: block;
    animation: ltcp-shake 0.5s;
}

@keyframes ltcp-shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .ltcp-overlay {
        padding: 10px;
    }

    .ltcp-popup {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 5px;
    }

    .ltcp-close-button {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .ltcp-close-button svg {
        width: 20px;
        height: 20px;
    }

    .ltcp-popup-header {
        padding: 20px;
        padding-right: 50px;
    }

    .ltcp-popup-header h2 {
        font-size: 20px;
    }

    .ltcp-popup-content {
        padding: 20px;
        padding-bottom: 50px;
        font-size: 14px;
    }

    .ltcp-scroll-indicator {
        bottom: 8px;
        padding: 10px 20px;
        font-size: 12px;
        max-width: calc(100% - 40px);
    }

    .ltcp-popup-footer {
        padding: 15px 20px;
    }

    .ltcp-accept-button {
        padding: 12px 25px;
        font-size: 15px;
        align-self: stretch;
    }
}

@media screen and (max-width: 480px) {
    .ltcp-popup-header h2 {
        font-size: 18px;
    }

    .ltcp-popup-header .ltcp-version {
        display: block;
        margin-left: 0;
        margin-top: 5px;
    }

    .ltcp-popup-content {
        font-size: 13px;
        padding: 15px;
        padding-bottom: 45px;
    }

    .ltcp-scroll-indicator {
        bottom: 5px;
        padding: 8px 16px;
        font-size: 11px;
        max-width: calc(100% - 30px);
    }

    .ltcp-checkbox-label span {
        font-size: 14px;
    }
}

/* Accessibility */
.ltcp-popup:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.ltcp-accept-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .ltcp-overlay {
        display: none !important;
    }
}
