/* Custom styles for SmartStudyAI */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #3B82F6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1E40AF;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Flashcard specific styles */
.flashcard-container {
    perspective: 1000px;
    min-height: 200px;
}

.flashcard {
    position: relative;
    width: 100%;
    height: 200px;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 8px;
    background: white;
    border: 2px solid #e5e7eb;
}

.flashcard-back {
    transform: rotateY(180deg);
    background: #f8fafc;
}

.flashcard-front h4,
.flashcard-back h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1f2937;
}

.flashcard-front p,
.flashcard-back p {
    color: #6b7280;
    line-height: 1.5;
}

/* Chat message animations */
.message-enter {
    animation: messageEnter 0.3s ease-out;
}

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

/* Loading animation */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* Quiz styles */
.quiz-question {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.quiz-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.quiz-option:hover {
    background: #f3f4f6;
}

.quiz-option input[type="radio"] {
    margin-right: 8px;
}

.quiz-option.correct {
    background: #dcfce7;
    border: 1px solid #16a34a;
}

.quiz-option.incorrect {
    background: #fee2e2;
    border: 1px solid #dc2626;
}

/* Button hover effects */
.btn-hover-scale {
    transition: transform 0.2s;
}

.btn-hover-scale:hover {
    transform: scale(1.05);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .flashcard-container {
        min-height: 150px;
    }
    
    .flashcard {
        height: 150px;
    }
    
    .flashcard-front h4,
    .flashcard-back h4 {
        font-size: 16px;
    }
    
    .flashcard-front p,
    .flashcard-back p {
        font-size: 14px;
    }
}

/* Gradient background for hero section */
.hero-bg {
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 50%, #06B6D4 100%);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Card hover effects */
.feature-card {
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Custom input focus styles */
.input-focus:focus {
    outline: none;
    ring: 2px;
    ring-color: #3B82F6;
    border-color: transparent;
}

/* Progress bar styles */
.progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #8B5CF6);
    transition: width 0.3s ease;
}

/* Status indicators */
.status-online {
    color: #10b981;
}

.status-offline {
    color: #ef4444;
}

/* Custom checkbox styles */
.custom-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    outline: none;
    transition: all 0.2s;
}

.custom-checkbox:checked {
    background: #3B82F6;
    border-color: #3B82F6;
}

.custom-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: #1f2937;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}