:root { 
    --primary-color: #5e72e4; 
    --secondary-color: #f4f5f7; /* Light gray for body background */
    --accent-color: #11cdef;
    --text-color-dark: #212529; 
    --text-color-light: #f8f9fa;
    --bg-color: #ffffff; 
    --light-gray: #f7fafc; 
    --border-color: #dee2e6;
    --dark-bg: #ffffff;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--secondary-color);
    min-height: 100vh; 
    color: #fff;
}
.container { 
    width: 100%;
    max-width: 1140px; 
    margin: 20px auto;
    background: var(--bg-color); 
    border-radius: 20px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    overflow: hidden; 
    animation: fadeIn 0.8s ease-out;
}
@media (min-width: 1600px) {
    .container {
        max-width: 1400px;
    }
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.user-bar {
    width: 100%;
    background: #172b4d;
    color: white;
    padding: 10px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.nav-content-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.user-bar a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}
.user-bar .logo a {
    font-size: 1.2rem;
}
.user-bar-desktop-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header { background: linear-gradient(135deg, #f5365c 0%, #f56036 100%); color: white; padding: 40px; text-align: center; }
.header h1 { font-size: 3rem; font-weight: 700; text-shadow: 0 2px 5px rgba(0,0,0,0.3); }
.header p { font-size: 1.3rem; opacity: 0.9; }

.main-content { padding: 40px; background-color: var(--dark-bg); }

.section-title { font-size: 1.8rem; font-weight: 600; margin-bottom: 30px; color: #fff; text-align: center; }

.choice-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.choice-card {
    color: white;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.choice-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.7);
}
.card-background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%);
    z-index: 0;
}
.choice-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 20%, rgba(0,0,0,0.1) 60%);
    z-index: 1;
    transition: background 0.3s ease;
}
.choice-card:hover::before {
    background: linear-gradient(to top, rgba(0,0,0,0.95) 25%, rgba(0,0,0,0.15) 70%);
}

/* === UPDATED RULES START HERE === */

.card-content {
    position: relative;
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* This now happens by default, not just on hover, to make space for buttons */
    transform: translateY(-80px);
}
.card-content h3 { font-size: 2.2rem; margin-bottom: 10px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.card-content p { font-size: 1.1rem; opacity: 0.8; line-height: 1.5; }

.card-actions {
    position: absolute;
    bottom: 25px;
    left: 0;
    width: 100%;
    text-align: center;
    /* This is now visible by default */
    opacity: 1;
    /* Transition is kept for smooth loading appearance */
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 3;
}

/* These rules that relied on hover are no longer needed */
/* .choice-card:hover .card-actions { opacity: 1; transform: translateY(0); } */
/* .choice-card:hover .card-content { transform: translateY(-80px); } */

/* === UPDATED RULES END HERE === */

.btn {
    display: inline-block;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 5px;
    border-radius: 50px;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    will-change: transform;
}
.btn:hover {
    transform: scale(1.05);
}
.btn-overlay {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(10px);
}
.btn-overlay:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}
.btn-action {
    background: var(--primary-color);
    color: white;
    border: none;
}
.btn-action:hover {
    background: #32325d;
}
.btn-action.btn-primary { background: linear-gradient(135deg, #f5365c 0%, #f56036 100%); }
.btn-action.btn-secondary { background: linear-gradient(135deg, #2dce89 0%, #2dcecc 100%); }
.btn-action.btn-tertiary { background: linear-gradient(135deg, #fb6340 0%, #fbb140 100%); }
.btn:active {
    animation: bounce 0.3s ease;
}
@keyframes bounce {
    0% { transform: scale(1.05); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.workflow-section { display: none; background: white; padding: 40px; border-radius: 15px; color: var(--text-color-dark); }
.workflow-section .section-title { color: var(--text-color-dark); }
.upload-area { border: 3px dashed var(--border-color); border-radius: 15px; padding: 60px 40px; text-align: center; background: var(--light-gray); transition: all 0.3s ease; cursor: pointer; }
.upload-area:hover, .upload-area.dragover { border-color: var(--primary-color); background: #e9ecef; }
.upload-icon { font-size: 4rem; color: var(--primary-color); margin-bottom: 20px; }
.file-input { display: none; }
.prompt-input { width: 100%; padding: 20px; font-size: 1.2rem; border: 1px solid var(--border-color); border-radius: 12px; resize: vertical; min-height: 120px; font-family: inherit; background: var(--bg-color); }
.prompt-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.2); }
.result-media { max-width: 100%; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,0.1); margin-bottom: 30px; }
.loading, .result-section { display: none; text-align: center; padding: 40px; background: white; border-radius: 15px; color: var(--text-color-dark); }
.loading .section-title, .result-section .section-title { color: var(--text-color-dark); }
.spinner { display: inline-block; width: 50px; height: 50px; border: 4px solid #f3f3f3; border-top: 4px solid var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
#progressContainer { width: 80%; margin: 20px auto; background-color: #e9ecef; border-radius: 10px; overflow: hidden; display: none; }
#progressBar { width: 0%; height: 25px; background-color: var(--accent-color); text-align: center; line-height: 25px; color: white; transition: width 0.4s ease; font-weight: bold; }
#progressBar.processing { background-image: linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent); background-size: 50px 50px; animation: candy-stripe 2s linear infinite; }
@keyframes candy-stripe { from { background-position: 50px 0; } to { background-position: 0 0; } }
.action-box { margin-top: 30px; padding-top: 30px; border-top: 2px dashed var(--border-color); }
.prompt-history { position: relative; background: var(--light-gray); border-left: 5px solid var(--primary-color); padding: 15px; padding-right: 100px; margin-bottom: 20px; text-align: left; border-radius: 5px; color: var(--text-color-dark); }
.prompt-history p { margin: 0; font-style: italic; color: #525f7f; }
.prompt-history .redo-btn { position: absolute; top: 50%; right: 15px; transform: translateY(-50%); background: white; border: 1px solid #ccc; color: #555; padding: 5px 10px; font-size: 0.8rem; text-transform: none; border-radius: 5px; cursor: pointer; }
.options-box { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding: 10px; border: 1px solid var(--border-color); border-radius: 10px; }
.options-box label { font-weight: 500; }
.toggle-switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(26px); }
.footer { text-align: center; padding: 30px; background-color: #121220; color: #aaa; border-top: 1px solid #333; }

@media (max-width: 768px) {
    body { padding: 0; }
    .container {
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
        margin: 0;
    }
    .header h1 { font-size: 2.5rem; }
    .header, .main-content, .workflow-section, .loading, .result-section { padding: 20px; }
    .choice-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .choice-card { min-height: 350px; }
}        

.user-bar-link {
    font-weight: bold;
    text-decoration: none;
}
.user-bar-link--admin {
    margin-right: 20px;
    color: #ffc107;
}
.user-bar-link--logout {
    color: #f5365c;
}

.form-page-container, .profile-card {
    padding: 40px;
    color: var(--text-color-dark);
    background-color: var(--bg-color);
    width: 100%;
    margin: 40px auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.form-page-container {
    max-width: 480px;
    text-align: center;
}
.form-page-container h2, .profile-card h3 {
    margin-bottom: 20px;
    color: #32325d;
}
.form-field {
    margin-bottom: 20px;
    text-align: left;
}
.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #525f7f;
}
.form-field input, .form-field select, .form-field textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.2);
}
.form-footer {
    margin-top: 30px;
    color: #8898aa;
    text-align: center;
}
.form-footer a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}
.form-footer a:hover {
    text-decoration: underline;
}
.form-field .error {
    display: block;
    color: #d8000c;
    background-color: #ffdddd;
    border: 1px solid #d8000c;
    border-radius: 5px;
    padding: 10px;
    margin-top: 8px;
    font-weight: bold;
    font-size: 0.9em;
}
.invitation-box {
    background-color: #e9ecef;
    border-left: 5px solid var(--primary-color);
    color: #495057;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 5px;
    text-align: left;
}
.invitation-box h3 {
    margin-top: 0;
    color: var(--text-color-dark);
}
.invitation-box p {
    margin-bottom: 0;
    line-height: 1.6;
}
.invitation-box strong {
    color: var(--primary-color);
}
.footer-link {
    color: #aaa;
    text-decoration: none;
}
.footer-link:hover {
    text-decoration: underline;
}
.error-message-local {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 1rem;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
}