/* Shadcn UI Style Components for PHP - Teal Theme */

/* CSS Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Teal Color Palette - Shadcn Style */
    --background: 0 0% 100%;
    --foreground: 240 10% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 240 10% 3.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 240 10% 3.9%;
    --primary: 173 80% 40%;
    --primary-foreground: 0 0% 98%;
    --secondary: 240 4.8% 95.9%;
    --secondary-foreground: 240 5.9% 10%;
    --muted: 240 4.8% 95.9%;
    --muted-foreground: 240 3.8% 46.1%;
    --accent: 240 4.8% 95.9%;
    --accent-foreground: 240 5.9% 10%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 240 5.9% 90%;
    --input: 240 5.9% 90%;
    --ring: 173 80% 40%;
    --radius: 0.5rem;
}

.dark {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 10% 3.9%;
    --card-foreground: 0 0% 98%;
    --popover: 240 10% 3.9%;
    --popover-foreground: 0 0% 98%;
    --primary: 173 80% 40%;
    --primary-foreground: 0 0% 98%;
    --secondary: 240 3.7% 15.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;
    --accent: 240 3.7% 15.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;
    --border: 240 3.7% 15.9%;
    --input: 240 3.7% 15.9%;
    --ring: 173 80% 40%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode toggle button */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    background-color: hsl(var(--accent));
    transform: scale(1.05);
}

.theme-toggle .icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.dark .theme-toggle .sun-icon {
    transform: rotate(180deg) scale(0);
}

.dark .theme-toggle .moon-icon {
    transform: rotate(0deg) scale(1);
}

.theme-toggle .sun-icon {
    transform: rotate(0deg) scale(1);
}

.theme-toggle .moon-icon {
    transform: rotate(-180deg) scale(0);
}

.theme-toggle .moon-icon,
.theme-toggle .sun-icon {
    position: absolute;
    transition: all 0.3s ease;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Card Component */
.card {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    transition: all 0.2s ease-in-out;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.dark .card {
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
}

.dark .card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
}

.card-content {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid hsl(var(--border));
    background-color: hsl(var(--muted) / 0.5);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.5rem;
}

.card-description {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    user-select: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}

.btn-primary:hover:not(:disabled) {
    background-color: hsl(var(--primary) / 0.9);
}

.btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border-color: hsl(var(--border));
}

.btn-secondary:hover:not(:disabled) {
    background-color: hsl(var(--secondary) / 0.8);
}

.btn-outline {
    background-color: transparent;
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
}

.btn-outline:hover:not(:disabled) {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-ghost {
    background-color: transparent;
    color: hsl(var(--foreground));
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-destructive {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
    border-color: hsl(var(--destructive));
}

.btn-destructive:hover:not(:disabled) {
    background-color: hsl(var(--destructive) / 0.9);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Input Components */
.input {
    display: flex;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--background));
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
}

.input:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input::placeholder {
    color: hsl(var(--muted-foreground));
}

/* Select Component */
.select {
    display: flex;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--background));
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.select:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* Label Component */
.label {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    margin-bottom: 0.5rem;
    display: block;
}

/* Form Group */
.form-group {
    margin-bottom: 1rem;
}

/* Badge Component */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-default {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.badge-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.badge-outline {
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
}

.badge-destructive {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

/* Alert Component */
.alert {
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    padding: 1rem;
    margin-bottom: 1rem;
}

.alert-default {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
}

.alert-destructive {
    background-color: hsl(var(--destructive) / 0.1);
    border-color: hsl(var(--destructive));
    color: hsl(var(--destructive));
}

.alert-success {
    background-color: hsl(142 76% 36% / 0.1);
    border-color: hsl(142 76% 36%);
    color: hsl(142 76% 36%);
}

/* Navigation */
.navbar {
    background-color: hsl(var(--background) / 0.95);
    border-bottom: 1px solid hsl(var(--border));
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.dark .navbar {
    background-color: hsl(var(--background) / 0.95);
    backdrop-filter: blur(16px);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: hsl(var(--primary));
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

.nav-link:hover {
    color: hsl(var(--foreground));
}

/* Layout */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid hsl(var(--muted));
    border-radius: 50%;
    border-top-color: hsl(var(--primary));
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .card-header,
    .card-content,
    .card-footer {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

/* Quiz Specific Styles */
.quiz-card {
    transition: all 0.2s ease-in-out;
}

.quiz-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.question-card {
    border-left: 4px solid hsl(var(--primary));
    background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(var(--muted) / 0.3) 100%);
}

.option-button {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 2px solid hsl(var(--border));
    background-color: hsl(var(--card));
    transition: all 0.2s ease-in-out;
}

.option-button:hover {
    border-color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.1);
}

.option-button.selected {
    border-color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.2);
    color: hsl(var(--primary));
}

/* AI Creator Styles */
.ai-creator-header {
    text-align: center;
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed hsl(var(--border));
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.upload-area:hover {
    border-color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.05);
}

.upload-area.file-selected {
    border-color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.1);
}

.processing-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.ai-brain {
    font-size: 4rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.processing-dots {
    display: flex;
    gap: 0.5rem;
}

.processing-dots span {
    width: 0.5rem;
    height: 0.5rem;
    background-color: hsl(var(--primary));
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.processing-dots span:nth-child(1) { animation-delay: -0.32s; }
.processing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Additional utility classes */
.w-full {
    width: 100%;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.space-y-1 > * + * {
    margin-top: 0.25rem;
}

.space-y-2 > * + * {
    margin-top: 0.5rem;
}

.space-y-3 > * + * {
    margin-top: 0.75rem;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.mr-3 {
    margin-right: 0.75rem;
}

.block {
    display: block;
}

.hidden {
    display: none;
}

.cursor-pointer {
    cursor: pointer;
}

.text-primary {
    color: hsl(var(--primary));
}

.hover\:underline:hover {
    text-decoration: underline;
}

.font-mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

/* Dark mode enhancements */
.dark {
    color-scheme: dark;
}

.dark .upload-area {
    border-color: hsl(var(--border));
    background-color: hsl(var(--card) / 0.5);
}

.dark .upload-area:hover {
    border-color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.1);
    box-shadow: 0 0 20px hsl(var(--primary) / 0.2);
}

.dark .processing-animation .ai-brain {
    text-shadow: 0 0 20px hsl(var(--primary) / 0.5);
}

.dark .badge-default {
    box-shadow: 0 0 10px hsl(var(--primary) / 0.3);
}

/* Smooth theme transitions */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* Dark mode specific animations */
@media (prefers-color-scheme: dark) {
    .dark .quiz-card {
        background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(var(--muted) / 0.2) 100%);
    }
}

/* Enhanced focus states for dark mode */
.dark .input:focus,
.dark .select:focus {
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.4), 0 0 20px hsl(var(--primary) / 0.2);
}

.dark .btn-primary:focus {
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.4), 0 0 25px hsl(var(--primary) / 0.4);
}
