@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #f0f2f5;
    --text-color: #333;
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --accent-color: #fdcb6e;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --nav-active: #6c5ce7;
    --nav-text: #666;
}

.dark-mode {
    --bg-color: #1e1e1e;
    --text-color: #f0f0f0;
    --primary-color: #a29bfe;
    --secondary-color: #6c5ce7;
    --glass-bg: rgba(30, 30, 30, 0.95);
    --glass-border: rgba(255, 255, 255, 0.05);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --nav-active: #a29bfe;
    --nav-text: #bbb;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

.app-wrapper {
    background: var(--glass-bg);
    width: 95%;
    max-width: 600px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 90vh;
    max-height: 800px;
    position: relative;
    overflow: hidden;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.app-header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
}

.controls-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

#language-selector {
    background: transparent;
    border: 1px solid var(--nav-text);
    color: var(--text-color);
    border-radius: 5px;
    padding: 2px 5px;
    font-size: 0.8rem;
}

/* Theme Switch */
.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}

.theme-switch input { display: none; }

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    background-color: #fff;
    bottom: 2px;
    content: "";
    height: 20px;
    left: 2px;
    position: absolute;
    transition: .4s;
    width: 20px;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(24px); }

/* Navigation */
.main-nav {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    background: rgba(0,0,0,0.02);
    border-radius: 10px;
    margin: 10px 0 20px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--nav-text);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.nav-btn.active, .nav-btn:hover {
    color: #fff;
    background-color: var(--nav-active);
    box-shadow: 0 2px 10px rgba(108, 92, 231, 0.3);
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.content-area::-webkit-scrollbar {
    width: 6px;
}
.content-area::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 3px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

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

/* Generator Styles */
.ticket-generator {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

#ticket-count {
    width: 60px;
    padding: 10px;
    border: 2px solid var(--bg-color);
    border-radius: 10px;
    text-align: center;
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-color);
}

.action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
    transition: transform 0.2s;
}

.action-btn:hover { transform: translateY(-2px); }

.lotto-tickets {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.lotto-ticket {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.lotto-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.buttons-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.secondary-btn {
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--nav-text);
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-btn:hover { background: var(--text-color); color: var(--bg-color); }

.text-btn {
    background: none;
    border: none;
    color: var(--nav-text);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Lunch & AI */
.lunch-display {
    text-align: center;
    margin: 40px 0;
}

.lunch-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.lunch-text {
    font-size: 1.5rem;
    font-weight: 600;
}

#ai-container {
    width: 100%;
}
#canvas {
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    max-width: 100%;
}

/* About Text */
.text-content h2 { font-size: 1.3rem; margin-bottom: 10px; color: var(--primary-color); }
.text-content h3 { font-size: 1.1rem; margin-top: 20px; margin-bottom: 5px; }
.text-content p { font-size: 0.9rem; line-height: 1.6; color: var(--nav-text); }

/* Footer */
footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--nav-text);
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

footer a { color: inherit; text-decoration: none; }
.separator { margin: 0 5px; }

/* Modal */
.modal {
    display: none; 
    position: fixed; 
    z-index: 200; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.6); 
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--glass-bg);
    margin: 20% auto; 
    padding: 20px;
    border-radius: 15px;
    width: 80%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.modal-content form { display: flex; flex-direction: column; gap: 10px; }
.modal-content input, .modal-content textarea {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-family: inherit;
}
.close-btn { float: right; font-size: 1.5rem; cursor: pointer; }