/* ============================================================
   COPY URL MODAL - PTTGC Style
   Exact replica of PTTGC OutSystems modal design
   ============================================================ */

/* ============================================================
   Modal Overlay (Background)
   ============================================================ */
.copy-url-modal-overlay {
    display: none; /* Hidden by default, shown via JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 110; /* Above most content, matching PTTGC */
    background-color: rgba(0, 0, 0, 0.25); /* Semi-transparent black overlay */
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.33s ease, visibility 0.33s ease;
}

/* Modal visible state */
.copy-url-modal-overlay.is-visible {
    display: flex; /* Maintain flex layout during visible state */
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   Modal Wrapper (Main Container)
   ============================================================ */
.copy-url-modal-wrapper {
    position: relative;
    width: 358px;
    max-width: 90%; /* Responsive on mobile */
    background-color: rgba(0, 0, 0, 0.78); /* Dark semi-transparent background matching PTTGC */
    border-radius: 20px; /* Rounded corners */
    box-shadow: rgba(0, 0, 0, 0.1) 0px 8px 10px 0px; /* Subtle shadow */
    color: rgb(255, 255, 255); /* White text */
    overflow: hidden;
    transform: scale(0.7);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/* Modal wrapper visible state - scale animation */
.copy-url-modal-overlay.is-visible .copy-url-modal-wrapper {
    transform: scale(1);
    opacity: 1;
}

/* ============================================================
   Modal Header
   ============================================================ */
.copy-url-modal-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0px; /* Top and horizontal padding */
    min-height: 63px;
}

.copy-url-modal-title {
    flex: 1;
    margin: 0;
    padding: 0;
    font-size: 26px; /* Large title matching PTTGC */
    font-weight: 400;
    line-height: 39px;
    text-align: center;
    color: rgb(255, 255, 255); /* White */
}

.copy-url-modal-close {
    flex-shrink: 0;
    width: 24px;
    height: 39px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    color: rgb(255, 255, 255); /* White X */
    font-size: 28px;
    line-height: 24px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.copy-url-modal-close:hover {
    opacity: 0.7;
}

.copy-url-modal-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* ============================================================
   Modal Content
   ============================================================ */
.copy-url-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px; /* Equal padding all sides */
    gap: 16px; /* Space between QR code and input */
}

/* QR Code Container */
.qr-code-container {
    display: inline-block;
    background: rgb(255, 255, 255); /* White background for QR */
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.qr-code-container canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* URL Input Field */
.copy-url-input {
    width: 100%;
    max-width: 310px;
    height: 40px;
    padding: 0 16px; /* Horizontal padding */
    background-color: rgb(255, 255, 255); /* White background */
    color: rgb(39, 43, 48); /* Dark text */
    font-size: 14px;
    font-weight: 400;
    line-height: 17.5px;
    text-align: left;
    border: 1px solid rgb(215, 215, 215); /* Light gray border */
    border-radius: 4px; /* Slightly rounded */
    cursor: text;
    box-shadow: none;
    transition: border-color 0.2s ease;
}

.copy-url-input:focus {
    outline: none;
    border-color: rgb(0, 86, 184); /* PTTGC blue on focus */
}

.copy-url-input:hover {
    border-color: rgb(180, 180, 180);
}

/* ============================================================
   Modal Footer
   ============================================================ */
.copy-url-modal-footer {
    display: flex;
    flex-direction: row; /* Changed from column to row for horizontal layout */
    align-items: center;
    justify-content: center; /* Center the buttons horizontally */
    padding: 0px 24px 24px; /* Only bottom and horizontal padding */
    gap: 12px;
}

/* Button Base Styles */
.copy-url-btn {
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: auto;
    flex: 1; /* Equal width for both buttons */
}

/* Primary button (Copy URL) - Blue */
.copy-url-btn-primary {
    background-color: rgb(0, 86, 184);
    color: rgb(255, 255, 255);
}

.copy-url-btn-primary:hover {
    background-color: rgb(0, 70, 150);
}

.copy-url-btn-primary:focus {
    outline: 2px solid rgb(0, 86, 184);
    outline-offset: 2px;
}

/* Secondary button (Download QR) - Gray */
.copy-url-btn-secondary {
    background-color: rgb(108, 117, 125);
    color: rgb(255, 255, 255);
}

.copy-url-btn-secondary:hover {
    background-color: rgb(90, 98, 104);
}

.copy-url-btn-secondary:focus {
    outline: 2px solid rgb(108, 117, 125);
    outline-offset: 2px;
}

/* ============================================================
   Click-to-Copy Functionality
   ============================================================ */
.copy-url-input-clickable {
    cursor: pointer;
    user-select: all;
}

.copy-url-input-clickable:active {
    background-color: rgb(245, 248, 250);
}

/* ============================================================
   Responsive Design
   ============================================================ */
@media (max-width: 768px) {
    .copy-url-modal-wrapper {
        width: 90%;
        max-width: 358px;
    }

    .copy-url-modal-title {
        font-size: 22px;
        line-height: 32px;
    }

    .copy-url-input {
        max-width: 100%;
        font-size: 13px;
    }

    .copy-url-btn {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .copy-url-modal-wrapper {
        width: 95%;
    }

    .copy-url-modal-header {
        padding: 16px 16px 0px;
    }

    .copy-url-modal-content {
        padding: 16px;
    }

    .copy-url-modal-footer {
        padding: 16px;
    }

    .copy-url-modal-title {
        font-size: 20px;
        line-height: 28px;
    }

    .qr-code-container {
        padding: 15px;
    }
}

/* ============================================================
   Accessibility Improvements
   ============================================================ */
.copy-url-modal-overlay[aria-hidden="true"] {
    display: none !important;
}

/* Focus trap styles */
.copy-url-modal-wrapper:focus {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .copy-url-modal-wrapper {
        border: 2px solid rgb(255, 255, 255);
    }

    .copy-url-btn {
        border: 2px solid rgb(0, 86, 184);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .copy-url-modal-overlay,
    .copy-url-modal-wrapper,
    .copy-url-btn,
    .copied-message {
        transition: none;
    }
}

/* ============================================================
   Print Styles (hide modal when printing)
   ============================================================ */
@media print {
    .copy-url-modal-overlay {
        display: none !important;
    }
}
