/* --- Alapbeállítások és Háttér --- */
:root {
    --primary-color-start: #36d1dc;
    --primary-color-end: #5b86e5;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --text-color: #1a2b4a;
    --panel-bg: rgba(255, 255, 255, 0.45);
    --panel-border: rgba(255, 255, 255, 0.7);
    --danger-color: #e53935;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Háttér animáció --- */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape1, .shape2 {
    position: absolute;
    border-radius: 50%;
    filter: blur(150px);
}

.shape1 {
    width: 600px;
    height: 600px;
    background: rgba(54, 209, 220, 0.4);
    top: -200px;
    left: -200px;
    animation: moveShape1 25s infinite alternate;
}

.shape2 {
    width: 500px;
    height: 500px;
    background: rgba(91, 134, 229, 0.4);
    bottom: -150px;
    right: -150px;
    animation: moveShape2 30s infinite alternate;
}

@keyframes moveShape1 {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(200px, 300px) rotate(180deg); }
}

@keyframes moveShape2 {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(-300px, -200px) rotate(-180deg); }
}


/* --- Üveg Panel Stílus --- */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    padding: 30px;
    box-sizing: border-box;
}

/* --- Fényes Gomb Stílus --- */
.glossy-button, .glossy-button-small {
    background: linear-gradient(to bottom, var(--primary-color-start), var(--primary-color-end));
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1), inset 0 1px 1px rgba(255,255,255,0.4);
    text-shadow: 0 -1px 1px rgba(0,0,0,0.2);
}

.glossy-button {
    padding: 12px 20px;
    font-size: 16px;
    width: 100%;
}

.glossy-button-small {
    padding: 8px 16px;
    font-size: 14px;
}

.glossy-button:hover, .glossy-button-small:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15), inset 0 1px 1px rgba(255,255,255,0.4);
}

.glossy-button:active, .glossy-button-small:active {
    filter: brightness(0.95);
    box-shadow: 0 1px 2px rgba(0,0,0,0.15), inset 0 1px 2px rgba(0,0,0,0.2);
    transform: translateY(1px);
}

.glossy-button-small.danger {
    background: linear-gradient(to bottom, #ff758c, #ff7eb3);
}

/* --- Authentikáció --- */
#auth-container {
    width: 400px;
    text-align: center;
    display: none;
    flex-direction: column;
    gap: 20px;
}
#auth-container.active { display: flex; }

.logo { width: 80px; height: 80px; margin: 0 auto; }
#auth-title { margin: 0; font-size: 28px; font-weight: 600; }

.auth-form { display: none; flex-direction: column; gap: 15px; }
.auth-form.active { display: flex; }

input[type="email"], input[type="password"], textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.2s;
}
input[type="email"]:focus, input[type="password"]:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color-start);
    box-shadow: 0 0 0 3px rgba(54, 209, 220, 0.3);
}

.switch-form-text a {
    color: var(--primary-color-end);
    font-weight: 600;
    text-decoration: none;
}
.error-message { color: var(--danger-color); font-size: 14px; min-height: 20px; }

/* --- Fő Alkalmazás Elrendezés --- */
#app-container {
    width: 95vw;
    height: 95vh;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-bottom: 1px solid var(--panel-border);
}
.header-left, .header-right { display: flex; align-items: center; gap: 15px; }
.logo-small { width: 40px; height: 40px; }
.app-header h1 { margin: 0; font-size: 24px; }

.main-layout {
    display: flex;
    flex-grow: 1;
    padding: 20px;
    gap: 20px;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.sidebar h3 { margin-top: 0; }
#subject-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    flex-grow: 1;
    overflow-y: auto;
}
#subject-list li {
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 5px;
    font-weight: 600;
}
#subject-list li:hover { background-color: rgba(255, 255, 255, 0.4); }
#subject-list li.active {
    background-color: var(--primary-color-end);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#welcome-screen {
    text-align: center;
    margin: auto;
    color: rgba(0,0,0,0.5);
}
#subject-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.subject-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
#subject-title { margin: 0; }

/* --- Tabok --- */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--panel-border);
    margin-bottom: 20px;
}
.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.7;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}
.tab-btn.active {
    opacity: 1;
    border-bottom-color: var(--primary-color-end);
}

.tab-content {
    display: none;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px; /* for scrollbar */
}
.tab-content.active { display: flex; flex-direction: column; }

/* --- Tartalom Stílusok (Jegyzetek, Fájlok, AI) --- */
#notes-list, #files-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}
.note-card, .file-card {
    background: rgba(255, 255, 255, 0.6);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.note-card h4 { margin: 0 0 5px 0; }
.note-card p { margin: 0; font-size: 14px; opacity: 0.8; }
.file-card a { color: var(--primary-color-end); text-decoration: none; font-weight: 600; }

.card-controls { display: flex; gap: 10px; }
.control-btn { background: none; border: none; cursor: pointer; font-size: 16px; color: var(--text-color); opacity: 0.6; transition: opacity 0.2s; }
.control-btn:hover { opacity: 1; }
.control-btn.delete:hover { color: var(--danger-color); }

#tab-ai { gap: 20px; }
#ai-response {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    padding: 15px;
    overflow-y: auto;
    line-height: 1.6;
}
.ai-input-area { display: flex; gap: 10px; }
#ai-prompt { flex-grow: 1; height: 50px; resize: none; }

/* --- Modális ablak --- */
#modal-container {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal-content {
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.modal-content h3 { margin: 0; }
.modal-buttons { display: flex; justify-content: flex-end; gap: 10px; }

/* --- Segédosztályok --- */
.hidden { display: none !important; }
