/* Viral Video Creator App Styles - v0.1.3 (Pexels UI updates) */
.vvc-creator-app {
    max-width: 650px;
    margin: 25px auto;
    padding: 25px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    background-color: #f6f7f7;
    overflow: hidden;
    position: relative;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.vvc-card {
    display: none;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #e0e2e4;
    border-radius: 4px;
    margin-bottom: 0;
    animation: vvcFadeIn 0.4s ease-in-out;
}

.vvc-card.active {
    display: block;
}

@keyframes vvcFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.vvc-card h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.5em;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.3;
}

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

.vvc-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #3c434a;
    font-size: 14px;
}

.vvc-form-group textarea,
.vvc-form-group select,
.vvc-form-group input[type="text"],
.vvc-form-group input[type="url"],
.vvc-form-group input[type="password"] { /* Added input types */
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    box-sizing: border-box;
    background-color: #fff;
    color: #3c434a;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.15s ease-in-out;
}
.vvc-form-group textarea {
    min-height: 85px;
}

.vvc-form-group textarea:focus,
.vvc-form-group select:focus,
.vvc-form-group input[type="text"]:focus, /* Added input types */
.vvc-form-group input[type="url"]:focus,
.vvc-form-group input[type="password"]:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    outline: 2px solid transparent;
    outline-offset: 0;
}

.vvc-button-group {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e2e4;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.vvc-button-group > .vvc-regenerate,
.vvc-button-group > .vvc-preview {
    margin-right: auto;
}


.vvc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    background-color: #007cba;
    color: white;
    border: 1px solid #007cba;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    min-width: 100px;
}

.vvc-button:hover:not(:disabled) {
    background-color: #006ba1;
    border-color: #006ba1;
    color: white;
}

.vvc-button:focus:not(:disabled) {
     border-color: #0a4b78;
     box-shadow: 0 0 0 1px #0a4b78;
     outline: 2px solid transparent;
     outline-offset: 0;
}


.vvc-button:active:not(:disabled) {
     background-color: #005a87;
     border-color: #005a87;
}


.vvc-button:disabled {
    background-color: #a7aaad;
    border-color: #a7aaad;
    color: #d6d8db;
    cursor: not-allowed;
    opacity: 0.7;
}

.vvc-button.vvc-regenerate,
.vvc-button.vvc-preview {
    background-color: #646970;
    border-color: #646970;
}
 .vvc-button.vvc-regenerate:hover:not(:disabled),
 .vvc-button.vvc-preview:hover:not(:disabled) {
    background-color: #4e5358;
    border-color: #4e5358;
 }
 .vvc-button.vvc-regenerate:active:not(:disabled),
 .vvc-button.vvc-preview:active:not(:disabled) {
      background-color: #3c434a;
      border-color: #3c434a;
 }

.vvc-button.vvc-loading {
    position: relative;
    color: transparent !important;
}

.vvc-button.vvc-loading::after {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.2em;
    height: 1.2em;
    margin-top: -0.6em;
    margin-left: -0.6em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: vvcSpin 0.8s linear infinite;
}

@keyframes vvcSpin {
    to { transform: rotate(360deg); }
}


.vvc-result-area {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f0f1;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    min-height: 60px;
    max-height: 250px;
    overflow-y: auto;
    line-height: 1.6;
    font-size: 14px;
    color: #3c434a;
}
.vvc-result-area > *:first-child {
    margin-top: 0;
}
.vvc-result-area > *:last-child {
    margin-bottom: 0;
}
.vvc-result-area p i {
    color: #646970;
}

.vvc-result-area audio {
    width: 100%;
    margin-top: 10px;
}
.vvc-result-area audio::-webkit-media-controls-panel {
  background-color: #e8e8e8;
  border-radius: 4px;
}


.vvc-status-message {
    padding: 12px 18px;
    margin: -25px -25px 20px -25px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid;
    font-size: 14px;
    display: none;
    line-height: 1.5;
}

.vvc-status-message:not(.error) {
    background-color: #e7f7df;
    color: #25500e;
    border-color: #d1ecca;
}

.vvc-status-message.error {
    background-color: #fbeaea;
    color: #721c24;
    border-color: #f5c6cb;
}

#vvc-final-progress {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e2e4;
}

#vvc-final-progress progress {
    width: 100%;
    height: 10px;
    margin-top: 10px;
    appearance: none;
    border: none;
    border-radius: 5px;
    overflow: hidden;
    background-color: #dcdcde;
}

#vvc-final-progress progress::-webkit-progress-bar {
    background-color: #dcdcde;
    border-radius: 5px;
}
#vvc-final-progress progress::-webkit-progress-value {
    background-color: #007cba;
    border-radius: 5px 0 0 5px;
    transition: width 0.3s ease;
}
#vvc-final-progress progress::-moz-progress-bar {
    background-color: #007cba;
     border-radius: 5px;
     transition: width 0.3s ease;
}

#vvc-progress-status {
    margin-top: 8px;
    font-size: 0.9em;
    color: #50575e;
    font-style: italic;
}

#vvc-final-summary {
    margin-bottom: 25px;
    font-size: 0.95em;
    line-height: 1.7;
    background: #fdfdfd;
    padding: 15px 20px;
    border: 1px solid #eee;
    border-radius: 3px;
}
#vvc-final-summary p {
    margin: 6px 0;
    color: #3c434a;
}
#vvc-final-summary strong {
    color: #1d2327;
    font-weight: 600;
    margin-right: 5px;
}

#vvc-final-video-output {
    margin-top: 20px;
    padding: 15px;
    background-color: #e7f7df;
    border: 1px solid #d1ecca;
    border-radius: 3px;
    display: none;
}
#vvc-final-video-output video {
    max-width: 100%;
    border-radius: 3px;
    background-color: #000; /* Fallback for video player */
}
#vvc-final-video-output a.vvc-download-button { /* More specific selector */
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #2ea22e;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-weight: 600;
}
#vvc-final-video-output a.vvc-download-button:hover {
    background-color: #278a27;
}


/* --- NEW PEXELS UI STYLES --- */
.vvc-pexels-results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Responsive grid */
    gap: 10px;
    margin-top: 15px;
    padding: 10px; /* Padding inside the results area */
    max-height: 350px; /* Max height for scroll */
    overflow-y: auto;
    border: 1px solid #dcdcde; /* Consistent with other result areas */
    background-color: #f9f9f9; /* Slightly different background */
    border-radius: 3px;
}

.vvc-pexels-item {
    position: relative;
    border: 1px solid #ccc;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer; /* Indicate clickable */
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease-in-out;
}
.vvc-pexels-item:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.vvc-pexels-item img {
    display: block;
    width: 100%;
    height: 100px; /* Fixed height for thumbnails */
    object-fit: cover; /* Cover to fill, might crop */
    background-color: #eee; /* Placeholder color for image loading */
}

.vvc-pexels-item-select {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.85em;
    display: flex; /* For aligning checkbox and text */
    align-items: center;
}

.vvc-pexels-item-select input[type="checkbox"] {
    margin-right: 5px;
    width: auto; /* Override default 100% width from .vvc-form-group */
    vertical-align: middle;
}
.vvc-pexels-item-select span {
    vertical-align: middle;
}

/* Style for selected Pexels item (optional, if needed) */
.vvc-pexels-item input[type="checkbox"]:checked + span {
    /* font-weight: bold; */ /* Example */
}
.vvc-pexels-item input[type="checkbox"]:checked ~ img { /* Or parent selector if JS adds a class */
    /* border: 2px solid #007cba; */ /* Example */
}

#vvc-pexels-selection-message {
    font-size: 0.9em;
    margin-top: 10px;
    padding: 5px;
    background-color: #e7f7df; /* Light green */
    color: #25500e;
    border: 1px solid #d1ecca;
    border-radius: 3px;
    text-align: center;
}

#vvc-pexels-loader p i { /* Style italic placeholder text for loader */
    color: #3c434a;
    font-weight: 500;
}

/* Make the results container have a distinct placeholder text style */
.vvc-pexels-results-container > p > i {
    display: block;
    text-align: center;
    padding: 20px;
    color: #646970;
}