/* Custom styles for SlideCraft, inspired by CharacterCraft's aesthetic */

/* Base body styling with a vibrant gradient background */
body {
    background: linear-gradient(135deg, #6b7280, #4b5563, #1f2937, #3b82f6);
    background-size: 400% 400%;
    animation: gradientShift 30s ease infinite;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1f2937;
    line-height: 1.6;
}

/* Gradient animation for dynamic background */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Theme-specific background variations */
body.light-theme {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db, #f3f4f6, #93c5fd);
    color: #1f2937;
}

body.dark-theme {
    background: linear-gradient(135deg, #1f2937, #374151, #4b5563, #1e40af);
    color: #e5e7f0;
}

body.light-theme.theme-earthy {
    background: linear-gradient(135deg, #8a9a5b, #a3b18a, #dad7cd, #588157);
}

body.dark-theme.theme-earthy {
    background: linear-gradient(135deg, #2d3748, #4a5568, #1a1a2e, #2f4f4f);
}

body.light-theme.theme-architecture {
    background: linear-gradient(135deg, #e0e0e0, #a9a9a9, #d3d3d3, #b0c4de);
}

body.dark-theme.theme-architecture {
    background: linear-gradient(135deg, #333333, #4a4a4a, #666666, #2f4f4f);
}

body.light-theme.theme-medieval {
    background: linear-gradient(135deg, #d2b48c, #8b4513, #deb887, #cd853f);
}

body.dark-theme.theme-medieval {
    background: linear-gradient(135deg, #3c2f2f, #5c4033, #2f1b0c, #4a3728);
}

body.light-theme.theme-space {
    background: linear-gradient(135deg, #1e1e2f, #4a90e2, #a3bffa, #1e90ff);
}

body.dark-theme.theme-space {
    background: linear-gradient(135deg, #0a0a1a, #1e40af, #3b82f6, #191970);
}

/* Container panels with card-like appearance */
#upload-screen,
#presentation-screen,
#quiz-screen,
#report-preview {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    padding: 2rem;
    margin: 1rem auto;
    max-width: 48rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark-theme #upload-screen,
body.dark-theme #presentation-screen,
body.dark-theme #quiz-screen,
body.dark-theme #report-preview {
    background: rgba(31, 41, 55, 0.85);
    color: #e5e7eb;
}

/* Hover effect for panels */
#upload-screen:hover,
#presentation-screen:hover,
#quiz-screen:hover,
#report-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

/* Header and footer styling */
header {
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 1rem 1rem;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

footer {
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.75rem;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    text-align: center;
    border-radius: 1rem 1rem 0 0;
    min-height: 3rem;
}

/* Button styling */
#start-button,
#prev-button,
#next-button,
#submit-quiz,
#restart-quiz,
#print-report {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s ease;
}

#start-button:hover,
#prev-button:hover,
#next-button:hover,
#submit-quiz:hover,
#restart-quiz:hover,
#print-report:hover {
    background: linear-gradient(90deg, #2563eb, #1e40af);
    transform: translateY(-2px);
}

body.dark-theme #start-button,
body.dark-theme #prev-button,
body.dark-theme #next-button,
body.dark-theme #submit-quiz,
body.dark-theme #restart-quiz,
body.dark-theme #print-report {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

body.dark-theme #start-button:hover,
body.dark-theme #prev-button:hover,
body.dark-theme #next-button:hover,
body.dark-theme #submit-quiz:hover,
body.dark-theme #restart-quiz:hover,
body.dark-theme #print-report:hover {
    background: linear-gradient(90deg, #3b82f6, #1e40af);
}

/* Input and select styling */
input[type="text"],
input[type="file"],
select {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

body.dark-theme input[type="text"],
body.dark-theme input[type="file"],
body.dark-theme select {
    background: rgba(75, 85, 99, 0.9);
    border-color: #6b7280;
    color: #e5e7eb;
}

input[type="text"]:focus,
input[type="file"]:focus,
select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* File input styling */
.photo-upload {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.photo-upload + span {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    z-index: 1;
}

body.dark-theme .photo-upload + span {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    color: #e5e7eb;
}

.photo-upload:hover + span {
    background: linear-gradient(90deg, #2563eb, #1e40af);
    transform: translateY(-2px);
}

body.dark-theme .photo-upload:hover + span {
    background: linear-gradient(90deg, #3b82f6, #1e40af);
}

.photo-upload:focus + span {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Image styling for presentation */
#step-image {
    width: 90%; /* 90% of browser width */
    max-height: 320px;
    object-fit: contain;
    border-radius: 1rem;
    margin: 1rem auto;
    display: block;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Inkblot animation */
#step-image.inkblot {
    animation: inkblotPulse 60s ease-in-out infinite;
}

@keyframes inkblotPulse {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.02) rotate(2deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Error message styling */
#error-message {
    color: #dc2626;
    font-weight: 500;
    text-align: center;
    margin-bottom: 1rem;
}

body.dark-theme #error-message {
    color: #f87171;
}

/* Text cushion for readability */
.text-cushion {
    padding: 0.75rem;
    line-height: 1.8;
    font-weight: 400;
    color: #1f2937;
}

body.dark-theme .text-cushion {
    color: #e5e7eb;
}

/* Quiz and report content styling */
#quiz-content,
#report-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

body.dark-theme #quiz-content,
body.dark-theme #report-content {
    background: rgba(55, 65, 81, 0.95);
    color: #e5e7eb;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    header, footer {
        padding: 0.75rem;
    }
    main {
        padding-top: 0.5rem;
        padding-bottom: 4rem;
    }
    #upload-screen, #quiz-screen, #report-preview {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    #step-image {
        width: 80%; /* Slightly smaller on mobile */
        max-height: 240px;
    }
    button {
        width: 100%;
        padding: 0.75rem;
    }
    header h1 {
        font-size: 1.5rem;
    }
    footer {
        min-height: 3.5rem;
    }
}

@media (min-width: 641px) {
    header, footer {
        padding: 1rem;
    }
    main {
        padding-top: 1rem;
        padding-bottom: 2rem;
    }
}