/* style-frontend.css - Styles for video recorder frontend UI */

.vrp-btn-main {
    background: #2056d6;
    color: #fff;
    font-size: 18px;
    padding: 10px 32px;
    border-radius: 32px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.vrp-btn-main:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vrp-btn-outline {
    border: 2px solid #2056d6;
    background: #fff;
    color: #2056d6;
    font-size: 18px;
    padding: 10px 32px;
    border-radius: 32px;
    margin-right: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.vrp-btn-outline:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#vrp-camera-area {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 320px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #2d3142;
    border-radius: 12px;
    overflow: hidden;
}
#vrp-countdown-overlay, #vrp-timer-overlay {
    box-sizing: border-box;
}

#vrp-preview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 12px;
    background: #222;
    z-index: 0;
}

/* --- Overlay styles: always above video, use .active for display --- */
#vrp-timer-overlay {
    position: absolute;
    bottom: 18px;
    right: 24px;
    font-size: 30px;
    color: #ff3333;
    background: rgba(0,0,0,0.4);
    padding: 4px 16px;
    border-radius: 8px;
    min-width: 70px;
    text-align: center;
    z-index: 200;
    pointer-events: none;
    display: none;
}
#vrp-timer-overlay.active {
    display: flex !important;
}
#vrp-countdown-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    align-content: center;
    font-size: 120px;
    color: #fff;
    font-weight: bold;
    background: rgba(0,0,0,0.3);
    z-index: 100;
    pointer-events: none;
    text-shadow: 0 4px 24px #000, 0 2px 8px #000;
    letter-spacing: 2px;
}
#vrp-countdown-overlay.active {
    display: flex !important;
}

/* --- Responsive adjustments for overlays/buttons --- */
@media (max-width: 600px) {
    #vrp-timer-overlay {
        font-size: 20px;
        bottom: 8px;
        right: 8px;
        min-width: 48px;
        padding: 2px 8px;
    }
    #vrp-countdown-overlay {
        font-size: 100px;
    }
    .vrp-btn-main, .vrp-btn-outline {
        font-size: 15px;
        padding: 8px 16px;
    }
}

/* Responsive release agreement popup */
.vrp-release-agreement {
    max-width: 420px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(32,86,214,0.08);
    padding: 24px 24px 18px 24px;
    font-size: 16px;
}
.vrp-release-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 18px;
    color: #2056d6;
}
.vrp-release-content {
    font-size: 15px;
    margin-bottom: 18px;
    line-height: 1.6;
    color: #222;
}
.vrp-release-checkbox {
    display: flex;
    align-items: flex-start;
    font-size: 16px;
    margin-bottom: 24px;
    gap: 10px;
    line-height: 1.5;
    flex-wrap: wrap;
}
.vrp-release-checkbox input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}
.vrp-release-checkbox b {
    white-space: nowrap;
}
#vrp-release-next {
    width: 100%;
    margin-top: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}
@media (max-width: 600px) {
    .vrp-release-agreement {
        max-width: 98vw;
        padding: 12px 6px 12px 6px;
        font-size: 14px;
    }
    .vrp-release-title {
        font-size: 16px;
    }
    .vrp-release-content {
        font-size: 13px;
    }
    .vrp-release-checkbox {
        font-size: 14px;
    }
}

.vrp-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 4px solid #eee;
    border-top: 4px solid #2056d6;
    border-radius: 50%;
    animation: vrp-spin 1s linear infinite;
}
@keyframes vrp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enforce 9:16 aspect ratio for camera preview */
#vrp-camera-area {
    aspect-ratio: 9/16;
    max-width: 360px;
    width: 100%;
    height: auto !important;
    background: #2d3142;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}
#vrp-preview {
    aspect-ratio: 9/16;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 12px;
    background: #222;
    display: block;
}
/* Fallback for browsers that do not support aspect-ratio */
@supports not (aspect-ratio: 9/16) {
    #vrp-camera-area::before {
        content: '';
        display: block;
        padding-top: 177.78%; /* 16/9 * 100% = 177.78% for 9:16 */
    }
    #vrp-camera-area {
        height: auto !important;
    }
    #vrp-preview {
        height: 100%;
    }
}

/* Camera preview aspect ratio (dynamic, supports 1:1 and 9:16) */
#vrp-camera-area[data-aspect="1-1"] {
    aspect-ratio: 1/1;
    max-width: 360px;
}
#vrp-preview[data-aspect="1-1"] {
    aspect-ratio: 1/1;
}
#vrp-camera-area[data-aspect="9-16"] {
    aspect-ratio: 9/16;
    max-width: 360px;
}
#vrp-preview[data-aspect="9-16"] {
    aspect-ratio: 9/16;
}
@supports not (aspect-ratio: 1/1) {
    #vrp-camera-area[data-aspect="1-1"]::before {
        content: '';
        display: block;
        padding-top: 100%;
    }
    #vrp-camera-area[data-aspect="9-16"]::before {
        content: '';
        display: block;
        padding-top: 177.78%;
    }
}

/* Camera Switch Button */
.vrp-btn-camera-switch {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 25px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.vrp-btn-camera-switch:hover {
    background: #f8f9fa;
    border-color: #2056d6;
    color: #2056d6;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.vrp-btn-camera-switch svg {
    width: 20px;
    height: 20px;
}

/* Small Camera Switch Button for Review Mode */
.vrp-btn-camera-switch-small {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.vrp-btn-camera-switch-small:hover {
    background: #e9ecef;
    border-color: #2056d6;
    color: #2056d6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.vrp-btn-camera-switch-small svg {
    width: 16px;
    height: 16px;
}

.vrp-btn-camera-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Camera-specific video styling */
#vrp-preview.vrp-back-camera {
    /* Back camera adapts to device orientation naturally */
    transform: none;
    object-fit: cover;
}

#vrp-preview.vrp-front-camera {
    /* Front camera mirrors for natural selfie view */
    transform: scaleX(-1);
    object-fit: cover;
}

/* Orientation responsive transforms */
@media screen and (orientation: landscape) {
    #vrp-preview.vrp-back-camera {
        /* In landscape mode, back camera uses natural orientation */
        transform: none;
    }
    
    #vrp-preview.vrp-front-camera {
        /* Front camera still mirrors in landscape */
        transform: scaleX(-1);
    }
}

@media screen and (orientation: portrait) {
    #vrp-preview.vrp-back-camera {
        /* In portrait mode, back camera adapts naturally */
        transform: none;
    }
    
    #vrp-preview.vrp-front-camera {
        /* Front camera mirrors in portrait */
        transform: scaleX(-1);
    }
}

.vrp-btn-camera-overlay:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(32, 86, 214, 0.6);
    color: #2056d6;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Animation cho rotate effect */
.vrp-btn-camera-overlay.rotating {
    animation: cameraRotate 0.6s ease-in-out;
}

@keyframes cameraRotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Checkbox styling for release agreement */
#vrp-agree-release {
    accent-color: #2056d6;
    transform: scale(1.2);
    cursor: pointer;
    margin-right: 8px;
    margin-top: 3px;
}

#vrp-agree-release:focus {
    outline: 2px solid #2056d6;
    outline-offset: 2px;
}

.vrp-release-checkbox label {
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    font-size: 14px;
    color: #333;
}

.vrp-release-checkbox label:hover {
    color: #2056d6;
}

/* Input field styling */
.vrp-form-input {
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease;
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
}

.vrp-form-input:focus {
    border-color: #2056d6 !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(32, 86, 214, 0.1);
}

