/**
 * @file style.css
 * @description Custom stylesheet for the AI Content Assistant.
 * Includes styles for theming, scroll animations, and all previous UI features.
 */

/* Import the Inter font family */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

body {
    font-family: 'Inter', sans-serif;
    /* Add a transition for smooth background changes when switching themes */
    transition: background-color 0.5s ease-in-out;
}

/* --- THEMES --- */
/* Each theme class changes the body background and the conic-gradient for the tracer border */

/* Default Theme: "Midnight" */
.theme-midnight { background-color: #0d1117; }
.theme-midnight .glass-card::before {
    background: conic-gradient(from 180deg at 50% 50%, #8A2BE2, #4169E1, #00FFFF, #8A2BE2);
}

/* New Theme: "Sunset" */
.theme-sunset { background-color: #2a2a2a; }
.theme-sunset .glass-card::before {
    background: conic-gradient(from 180deg at 50% 50%, #ff7e5f, #feb47b, #ff7e5f);
}

/* New Theme: "Ocean" */
.theme-ocean { background-color: #001f3f; }
.theme-ocean .glass-card::before {
    background: conic-gradient(from 180deg at 50% 50%, #2980B9, #6DD5FA, #FFFFFF, #2980B9);
}


/* --- Tracer Border Card Styles --- */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    opacity: 0;
    animation: spin 4s linear infinite;
    transition: opacity 0.3s ease-in-out;
}

.glass-card:hover::before {
    opacity: 1;
}

.glass-card::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: #161b22;
    border-radius: 1rem;
}

.card-content {
    position: relative;
    z-index: 10;
}

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


/* --- NEW: Scroll Animation Styles --- */
/* The initial state of elements that will be animated on scroll */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
/* The final state when the element is visible */
.scroll-animate.in-view {
    opacity: 1;
    transform: translateY(0);
}


/* --- Other styles --- */
@keyframes slide-in-fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-slide-in {
    animation: slide-in-fade-in 0.5s ease-out forwards;
}
.copy-btn .copy-icon {
    opacity: 1;
    transform: scale(1);
}
.copy-btn .check-icon {
    opacity: 0;
    transform: scale(0);
}
.copy-btn.copied .copy-icon {
    opacity: 0;
    transform: scale(0);
}
.copy-btn.copied .check-icon {
    opacity: 1;
    transform: scale(1);
}
.copy-btn .copy-feedback {
    position: absolute;
    top: -28px;
    right: 50%;
    transform: translateX(50%);
    background-color: #10B981;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 9999px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
    white-space: nowrap;
}
.copy-btn.copied .copy-feedback {
    opacity: 1;
}
.skeleton {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    position: relative;
    overflow: hidden;
}
.skeleton.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}
.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}
#summaryOutput {
    white-space: pre-wrap;
    word-wrap: break-word;
}
/* Theme Switcher Styles */
#themeSwitcher {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 50;
}
#themePanel {
    transform-origin: bottom right;
}

/* --- NEW: Auth Modal Styles --- */
#authModal {
    transition: opacity 0.3s ease-in-out;
}

/* --- Fix for History Items with new theme --- */
/* This ensures the dynamically created history cards get the tracer border effect */
#historyList .glass-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
#historyList .glass-card::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    opacity: 0;
    animation: spin 4s linear infinite;
    transition: opacity 0.3s ease-in-out;
}
#historyList .glass-card:hover::before {
    opacity: 1;
}
#historyList .glass-card::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: #161b22;
    border-radius: 1rem;
}
#historyList .card-content {
    position: relative;
    z-index: 10;
}

/* --- Task Manager Integration Styles --- */
#exportMenu {
    transform-origin: top right;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

#taskManagerModal {
    transition: opacity 0.3s ease-in-out;
}

.export-option:hover {
    transform: translateX(2px);
}

#confirmTaskManagerBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#confirmTaskManagerBtn:disabled:hover {
    background-color: #7C3AED; /* Keep original purple color when disabled */
}