/* AI Coaching Service - Glassmorphism Forest Theme */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=Kalam:wght@400;700&family=Indie+Flower&family=Patrick+Hand&family=Shadows+Into+Light&family=Playfair+Display:wght@400;600&family=Inter:wght@400;500;600&display=swap');

:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-bg-stronger: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #f5f5f0;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent: #d4a574;
    --accent-light: #e8c49a;
    --success: #7cb97c;
    --warning: #e8b84a;
    --error: #d97373;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background: url('/static/background.jpg') no-repeat center center fixed;
    background-size: cover;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(20, 30, 20, 0.6) 0%, rgba(40, 50, 40, 0.7) 100%);
    z-index: -1;
}

a {
    color: var(--accent-light);
    text-decoration: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-light);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(0, 0, 0, 0.2);
}

a:hover {
    text-decoration: underline;
}

/* Glass Panel */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px var(--shadow);
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 0.5rem;
    padding: 1rem 0;
}

header h1 {
    font-family: 'Caveat', cursive;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px var(--shadow);
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 400;
}

/* Sections */
section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 32px var(--shadow);
}

section h2 {
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--accent-light);
    font-weight: 600;
}

/* Navigation */
nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

nav a {
    font-size: 1.3rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

nav a { font-family: 'Caveat', cursive; }

nav a:hover, nav a.active {
    color: var(--text-primary);
    background: var(--glass-bg);
}

/* Features - Typography Only */
.features {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.feature {
    padding: 1.25rem 0 1.25rem 1.5rem;
    border-left: 3px solid var(--accent);
    transition: border-color 0.2s, padding-left 0.2s;
}

.feature:hover {
    border-left-color: var(--accent-light);
    padding-left: 2rem;
}

.feature h3 {
    font-family: 'Caveat', cursive;
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.feature p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

/* Access Form */
.access-form {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.access-form input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.access-form input::placeholder {
    color: var(--text-secondary);
}

.access-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}

.access-form button,
button {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: #1a1a1a;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.4);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--glass-bg-stronger);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 20px var(--shadow);
}

/* Error */
.error {
    color: var(--error);
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(217, 115, 115, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(217, 115, 115, 0.3);
}

.note {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Disclaimer */
.disclaimer {
    background: rgba(217, 115, 115, 0.1);
    border: 1px solid rgba(217, 115, 115, 0.3);
}

.disclaimer ul {
    list-style: none;
    padding-left: 0;
}

.disclaimer li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.disclaimer li::before {
    content: "⚠";
    position: absolute;
    left: 0;
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 2rem;
    padding: 1rem;
}

/* ===== CHAT PAGE ===== */

.chat-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1rem;
}

.chat-page body {
    padding: 0;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
}

.chat-header h1 {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    font-weight: 600;
}

.session-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.session-info button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message {
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message-content {
    padding: 1rem 1.5rem;
    border-radius: 20px;
    line-height: 1.6;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: #1a1a1a;
    border-bottom-right-radius: 6px;
}

.message.assistant .message-content {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 6px;
}

/* Thinking indicator */
.thinking {
    display: flex;
    gap: 4px;
    padding: 1rem 1.5rem;
}

.thinking span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: thinking 1.4s ease-in-out infinite;
}

.thinking span:nth-child(2) { animation-delay: 0.2s; }
.thinking span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-6px); opacity: 1; }
}

/* Chat Input */
.chat-input-area {
    padding: 1.25rem 2rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--glass-border);
}

.chat-form {
    display: flex;
    gap: 1rem;
}

.chat-form textarea {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    min-height: 50px;
    max-height: 150px;
}

.chat-form textarea::placeholder {
    color: var(--text-secondary);
}

.chat-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}

.chat-form button {
    align-self: flex-end;
    padding: 1rem 1.75rem;
}

.hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.75rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px var(--shadow);
}

.modal-content h2 {
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Summary export */
.summary-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
}

.summary-box textarea {
    width: 100%;
    min-height: 150px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.summary-box textarea:focus {
    outline: none;
}

/* ===== ADMIN PAGE ===== */

.admin-section {
    margin-bottom: 2rem;
}

.inline-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.inline-form input {
    padding: 0.5rem 0.75rem;
    width: 80px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
}

.code-list {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.code-list pre {
    font-family: 'SF Mono', Monaco, monospace;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    color: var(--text-secondary);
    font-weight: 500;
}

tr.used {
    opacity: 0.6;
}

code {
    font-family: 'SF Mono', Monaco, monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2.25rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .access-form {
        flex-direction: column;
    }
    
    .chat-page {
        padding: 0.5rem;
    }
    
    .chat-container {
        border-radius: 16px;
    }
    
    .chat-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .session-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .chat-messages {
        padding: 1rem;
    }
    
    .message {
        max-width: 90%;
    }
    
    .chat-input-area {
        padding: 1rem;
    }
}
