/* General App Styles */
.photobooth-app-container {
    font-family: sans-serif; /* Fallback font */
    color: #333; /* Fallback color */
    line-height: 1.6;
    position: relative; /* Add this for positioning context */
}

.photobooth-step {
    padding: 20px;
}

.photobooth-container {
    max-width: 960px;
    margin: 0 auto;
    /* Padding will be controlled by Elementor */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Override text-align for form elements */
.photobooth-container .photobooth-welcome-form {
    text-align: left;
}

.photobooth-header h1 {
    /* Font size and color will be controlled by Elementor */
    margin-bottom: 10px;
}

.photobooth-header p {
    /* Font size and color will be controlled by Elementor */
    margin-bottom: 20px;
}

/* Layout Selector */
.photobooth-layout-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.photobooth-layout-card {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photobooth-layout-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.photobooth-card-preview {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #f4f4f4;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    width: 80px; /* Example width */
}

.photobooth-pose-box {
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    background: #ccc;
    border-radius: 3px;
}

.photobooth-card-desc h3 {
    margin: 0 0 5px;
    font-size: 1.2em;
    text-align: center;
}

.photobooth-card-desc p {
    margin: 0;
    color: #666;
    font-size: 0.95em;
}

/* Capture Step */
.photobooth-capture-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center !important; /* Center the main capture area - use !important to ensure it works */
    width: 100%; /* Ensure wrapper takes full width */
    position: relative;
    flex-direction: column;
}

/* Sidebar now holds frame options */
.photobooth-capture-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.photobooth-main-capture-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px; /* Add a max-width to prevent it from getting too large */
    width: 100%; /* Ensure it takes available width up to max-width */
    margin: 0 auto !important; /* Center the capture area - use !important to override any conflicting rules */
    flex-shrink: 0; /* Prevent shrinking */
    align-self: center; /* Center within flex container */
}

.photobooth-camera-view {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

/* NEW: Camera Frame Overlay */
.photobooth-camera-frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicking through to the video/buttons */
    z-index: 2; /* Sits above the video */
}

.photobooth-camera-frame-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* or contain, depending on desired effect */
}


#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    background: #000;
}

.photobooth-frame-selection-above-button {
    width: 100%;
    margin-top: 15px;
}

.photobooth-frame-selection-above-button .photobooth-option-group {
    text-align: center;
}

.photobooth-action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.photobooth-action-buttons .photobooth-button {
    flex: 1;
}

.photobooth-countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    color: white;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
    z-index: 10;
}

.photobooth-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}

@keyframes flash {
    from { opacity: 0.8; }
    to { opacity: 0; }
}

.photobooth-flash.flash {
    animation: flash 0.4s ease-out;
}

.photobooth-filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    /* flex-direction and justify-content will be controlled by Elementor */
}

.photobooth-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.photobooth-thumbnail {
    width: 100%;
    border-radius: 4px;
    aspect-ratio: 1 / 1; /* Changed from 4 / 3 */
    object-fit: cover;
}

/* Customize Step */
.photobooth-customize-wrapper {
    display: flex;
    flex-direction: column; /* Change to vertical layout */
    align-items: center;    /* Center items horizontally */
    gap: 25px;              /* Add space between items */
}

.photobooth-preview-area {
    width: 100%;
    max-width: 400px; /* CRITICAL: Constrain the width to make the preview visible */
    box-sizing: border-box; 
}

/* New styles for the preview wrapper */
#photobooth-preview-wrapper {
    width: 100%;
    /* The height/aspect ratio is controlled by inline padding-bottom style */
    position: relative; /* Crucial for positioning the <img> tags inside */
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid #ddd; 
    border-radius: 8px;
}

/* Remove the empty options area and its styles */
.photobooth-options-area {
   display: none;
}

.photobooth-action-buttons-customize {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 400px; /* Match the preview area width */
}

.photobooth-option-group {
    text-align: center; /* Center the "Choose a Frame" heading */
    width: 100%;
}
.photobooth-option-group h4 {
    margin-top: 0;
    margin-bottom: 15px;
}

.photobooth-color-options,
.photobooth-image-frame-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center; /* Center the frame images */
}

.color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ddd;
    background: transparent;
    padding: 0;
}
.color-option.active {
    border-color: #0073aa;
}

.photobooth-image-frame-options img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid #ddd;
}

.photobooth-image-frame-options img.active {
    border-color: #0073aa;
}


/* Email Modal Styles */
.photobooth-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
}

.photobooth-modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 500px;
    border-radius: 8px;
    text-align: center;
    position: relative;
}

.photobooth-modal-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
}

.photobooth-modal-close:hover,
.photobooth-modal-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#photobooth-email-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

#photobooth-recipient-email {
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.photobooth-email-status {
    margin-top: 15px;
    font-weight: bold;
}

/* Progress Bar Styles */
.photobooth-progress-container {
    margin-top: 20px;
    padding: 15px 0;
}

.photobooth-progress-stage {
    font-size: 0.95em;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
    min-height: 20px;
}

.photobooth-progress-bar-wrapper {
    width: 100%;
    height: 24px;
    background-color: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}

.photobooth-progress-bar {
    height: 100%;
    width: 0%;
    background-color: #2196F3;
    border-radius: 12px;
    transition: width 0.3s ease, background-color 0.3s ease;
    position: relative;
}

.photobooth-progress-bar.progress-success {
    background-color: #4caf50;
}

.photobooth-progress-bar.progress-error {
    background-color: #f44336;
}

.photobooth-progress-text {
    font-size: 0.9em;
    color: #666;
    font-weight: 600;
    text-align: center;
}

/* Responsive Design for Progress Bar */
@media (max-width: 768px) {
    .photobooth-progress-container {
        margin-top: 15px;
        padding: 12px 0;
    }
    
    .photobooth-progress-stage {
        font-size: 0.9em;
        margin-bottom: 8px;
    }
    
    .photobooth-progress-bar-wrapper {
        height: 20px;
    }
    
    .photobooth-progress-text {
        font-size: 0.85em;
    }
}


/* Buttons */
.photobooth-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1em;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    /* width: 100%; */ /* Bu satır kaldırıldı */
    /* Border-radius will be controlled by Elementor */
}
.photobooth-button-primary {
    /* Background and text color will be controlled by Elementor */
    background-color: #0073aa; /* Fallback color */
    color: #fff; /* Fallback color */
    border-color: #0073aa; /* Fallback color */
}
.photobooth-button-primary:hover {
    background-color: #005a87;
}

.photobooth-button-secondary {
    background-color: #f0f0f1;
    color: #1d2327;
    border-color: #f0f0f1;
}
.photobooth-button-secondary:hover {
    background-color: #e6e6e7;
}

.filter-option.active {
    background-color: #0073aa;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .photobooth-capture-wrapper {
        flex-direction: column-reverse;
        align-items: center !important; /* Center items on mobile */
        justify-content: center !important; /* Ensure centering on mobile */
    }
    
    .photobooth-main-capture-area {
        margin: 0 auto !important; /* Ensure centering on mobile */
        width: 100%;
        max-width: 100%;
    }

    .photobooth-customize-wrapper {
        flex-direction: column;
    }

    .photobooth-action-buttons-customize {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        gap: 10px;
    }
    
    .photobooth-action-buttons-customize .photobooth-button {
        width: 100%;
    }

    .photobooth-layout-selector {
        grid-template-columns: 1fr;
    }
}

/* Processing Step Overlay */
.photobooth-processing-overlay {
    position: absolute; /* Changed back to absolute to be relative to the container */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    flex-direction: column;
}

.photobooth-processing-content {
    text-align: center;
}

.photobooth-processing-text {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: #333;
}

.photobooth-loading-bar-container {
    width: 200px;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.photobooth-loading-bar {
    width: 100%;
    height: 100%;
    background-color: #0073aa;
    animation: loading-animation 2s infinite linear;
}

@keyframes loading-animation {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Welcome Form Styles */
.photobooth-welcome-form {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
    position: relative;
    z-index: 1;
}

.photobooth-form-group {
    margin-bottom: 20px;
}

.photobooth-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.photobooth-form-group input[type="text"],
.photobooth-form-group input[type="email"],
.photobooth-form-group select,
.photobooth-form-group textarea {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.photobooth-form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.photobooth-form-group select {
    background-color: #fff;
    cursor: pointer;
    pointer-events: auto !important;
    position: relative;
    z-index: 10 !important;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    appearance: menulist;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.photobooth-form-group select:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.photobooth-form-group select option {
    padding: 8px 10px;
    background-color: #fff;
    color: #333;
    display: block;
}

/* Ensure select dropdown is visible and functional */
#photobooth-city {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 40px;
    overflow: visible !important;
}

#photobooth-city option {
    padding: 8px 10px;
    background-color: #fff;
    color: #333;
    display: block;
    white-space: normal;
}

.photobooth-form-error {
    color: #d63638;
    background-color: #fcf0f1;
    padding: 10px;
    border-radius: 4px;
}

/* Status Message Styles */
.photobooth-status-message {
    margin-top: 15px;
    padding: 12px 20px;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.photobooth-status-message.success {
    background-color: #4caf50;
    color: #ffffff;
}

.photobooth-status-message.error {
    background-color: #f44336;
    color: #ffffff;
}

.photobooth-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.photobooth-checkbox-group input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.photobooth-checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
}
