/**
 * Matheno Lysaria Plugin Styles
 * Version: 1.0.0
 */

/* CSS Variables */
:root {
    --matheno-primary: #6366f1;
    --matheno-primary-dark: #4f46e5;
    --matheno-secondary: #22d3ee;
    --matheno-accent: #f472b6;
    --matheno-success: #34d399;
    --matheno-warning: #fbbf24;
    --matheno-bg-dark: #0f172a;
    --matheno-bg-card: #1e293b;
    --matheno-bg-hover: #334155;
    --matheno-text-primary: #f8fafc;
    --matheno-text-secondary: #94a3b8;
    --matheno-border: #334155;
    --matheno-radius: 16px;
    --matheno-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Main App Container */
.matheno-lysaria-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--matheno-bg-dark) 0%, #1a1a2e 100%);
    color: var(--matheno-text-primary);
    padding: 40px 20px;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.matheno-lysaria-app::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(34, 211, 238, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.matheno-lysaria-app > * {
    position: relative;
    z-index: 1;
}

/* Header */
.matheno-header {
    text-align: center;
    margin-bottom: 40px;
}

.matheno-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 10px 0;
    letter-spacing: -1px;
}

.matheno-emoji {
    display: inline-block;
    animation: matheno-bounce 2s ease-in-out infinite;
    -webkit-text-fill-color: initial;
}

@keyframes matheno-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.matheno-subtitle {
    font-size: 1.1rem;
    color: var(--matheno-text-secondary);
    margin: 0 0 15px 0;
}

.matheno-badge {
    display: inline-block;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: var(--matheno-bg-dark);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    animation: matheno-pulse 2s ease-in-out infinite;
}

@keyframes matheno-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(67, 233, 123, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(67, 233, 123, 0); }
}

/* Search */
.matheno-search-container {
    max-width: 600px;
    margin: 0 auto 40px;
    position: relative;
}

.matheno-search-box {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid var(--matheno-border);
    border-radius: 50px;
    background: var(--matheno-bg-card);
    color: var(--matheno-text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.matheno-search-box:focus {
    outline: none;
    border-color: var(--matheno-primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.matheno-search-box::placeholder {
    color: var(--matheno-text-secondary);
}

.matheno-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.6;
}

/* Content */
.matheno-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* Categories */
.matheno-category {
    margin-bottom: 50px;
}

.matheno-category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--matheno-border);
    flex-wrap: wrap;
}

.matheno-category-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.matheno-category-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--matheno-text-primary);
}

.matheno-category-count {
    background: var(--matheno-bg-hover);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--matheno-text-secondary);
}

/* Subjects Grid */
.matheno-subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

/* Subject Card */
.matheno-subject-card {
    background: var(--matheno-bg-card);
    border-radius: var(--matheno-radius);
    padding: 25px;
    border: 1px solid var(--matheno-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.matheno-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.matheno-subject-card:hover {
    transform: translateY(-5px);
    border-color: var(--matheno-primary);
    box-shadow: var(--matheno-shadow);
}

.matheno-subject-card:hover .matheno-card-accent {
    opacity: 1;
}

.matheno-subject-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.matheno-subject-emoji {
    font-size: 2.5rem;
    line-height: 1;
}

.matheno-subject-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: var(--matheno-text-primary);
}

.matheno-subject-info p {
    font-size: 0.9rem;
    color: var(--matheno-text-secondary);
    margin: 0;
}

/* Chapters Accordion */
.matheno-chapters-accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.matheno-chapter-item {
    background: var(--matheno-bg-dark);
    border-radius: 12px;
    overflow: hidden;
}

.matheno-chapter-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.matheno-chapter-header:hover {
    background: var(--matheno-bg-hover);
}

.matheno-chapter-icon {
    font-size: 1rem;
}

.matheno-chapter-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.matheno-chapter-page {
    font-size: 0.75rem;
    color: var(--matheno-text-secondary);
    background: var(--matheno-bg-hover);
    padding: 3px 8px;
    border-radius: 6px;
}

.matheno-chapter-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s;
    color: var(--matheno-text-secondary);
}

.matheno-chapter-item.open .matheno-chapter-arrow {
    transform: rotate(180deg);
}

/* Solutions */
.matheno-solutions-container {
    padding: 0 15px 15px;
}

.matheno-solution-item {
    background: var(--matheno-bg-card);
    border-radius: 10px;
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid var(--matheno-border);
}

.matheno-solution-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.matheno-solution-header:hover {
    background: var(--matheno-bg-hover);
}

.matheno-solution-icon {
    font-size: 1rem;
}

.matheno-solution-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.matheno-solution-toggle {
    width: 24px;
    height: 24px;
    background: var(--matheno-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    transition: transform 0.3s, background 0.3s;
}

.matheno-solution-item.open .matheno-solution-toggle {
    transform: rotate(45deg);
    background: var(--matheno-accent);
}

.matheno-solution-content {
    padding: 20px;
    border-top: 1px solid var(--matheno-border);
    line-height: 1.7;
}

.matheno-solution-content h4 {
    color: var(--matheno-secondary);
    margin: 20px 0 10px 0;
    font-size: 1.1rem;
}

.matheno-solution-content h4:first-child {
    margin-top: 0;
}

.matheno-solution-content p {
    margin: 10px 0;
}

.matheno-solution-content strong {
    color: var(--matheno-accent);
}

.matheno-solution-content em {
    color: var(--matheno-text-secondary);
    font-style: italic;
}

.matheno-solution-content ul,
.matheno-solution-content ol {
    margin: 10px 0;
    padding-left: 25px;
}

.matheno-solution-content li {
    margin: 5px 0;
}

.matheno-solution-content sup {
    font-size: 0.7em;
    vertical-align: super;
}

/* No results messages */
.matheno-no-solutions,
.matheno-no-chapters {
    color: var(--matheno-text-secondary);
    font-style: italic;
    padding: 15px;
    text-align: center;
}

/* Tip Box */
.matheno-tip-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(244, 114, 182, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--matheno-radius);
    padding: 30px;
    margin: 50px auto;
    max-width: 800px;
    text-align: center;
}

.matheno-tip-box h3 {
    font-size: 1.3rem;
    margin: 0 0 15px 0;
    color: var(--matheno-accent);
}

.matheno-tip-box p {
    color: var(--matheno-text-secondary);
    line-height: 1.8;
    margin: 0;
}

/* No Results */
.matheno-no-results {
    text-align: center;
    padding: 60px 20px;
}

.matheno-no-results-emoji {
    font-size: 4rem;
    margin-bottom: 20px;
}

.matheno-no-results h3 {
    margin: 0 0 10px 0;
    color: var(--matheno-text-primary);
}

.matheno-no-results p {
    color: var(--matheno-text-secondary);
    margin: 0;
}

/* Footer */
.matheno-footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--matheno-border);
    margin-top: 50px;
}

.matheno-footer p {
    color: var(--matheno-text-secondary);
    margin: 0;
}

.matheno-footer a {
    color: var(--matheno-primary);
    text-decoration: none;
}

.matheno-footer a:hover {
    text-decoration: underline;
}

/* Ad Slots */
.matheno-ad {
    margin: 30px auto;
    max-width: 800px;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--matheno-border);
    border-radius: var(--matheno-radius);
}

.matheno-ad:empty::before {
    content: '📢 Διαφήμιση';
    color: var(--matheno-text-secondary);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .matheno-lysaria-app {
        padding: 20px 15px;
    }
    
    .matheno-subjects-grid {
        grid-template-columns: 1fr;
    }
    
    .matheno-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .matheno-title {
        font-size: 1.8rem;
    }
    
    .matheno-subject-card {
        padding: 20px;
    }
}

/* Animation for cards */
.matheno-subject-card {
    opacity: 0;
    transform: translateY(20px);
    animation: matheno-fadeInUp 0.5s ease forwards;
}

.matheno-subject-card:nth-child(1) { animation-delay: 0.1s; }
.matheno-subject-card:nth-child(2) { animation-delay: 0.15s; }
.matheno-subject-card:nth-child(3) { animation-delay: 0.2s; }
.matheno-subject-card:nth-child(4) { animation-delay: 0.25s; }
.matheno-subject-card:nth-child(5) { animation-delay: 0.3s; }
.matheno-subject-card:nth-child(6) { animation-delay: 0.35s; }

@keyframes matheno-fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hidden class for search */
.matheno-hidden {
    display: none !important;
}

/* Print styles */
@media print {
    .matheno-lysaria-app {
        background: white;
        color: black;
    }
    
    .matheno-header,
    .matheno-search-container,
    .matheno-ad,
    .matheno-tip-box,
    .matheno-footer {
        display: none;
    }
    
    .matheno-subject-card {
        background: white;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .matheno-solution-content {
        display: block !important;
    }
}
