:root {
    --primary-color: #4CAF50; /* ירוק חי */
    --secondary-color: #FF9800; /* כתום משחקי */
    --bg-color: #f0f8ff; /* תכלת עדין */
    --text-color: #333;
    --box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    --border-radius: 16px;
    --blue-result: #1565c0; /* כחול אלגנטי לתוצאות המורכבות */
    --green-result: #2e7d32;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Rubik', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: radial-gradient(circle at top right, #e3ffe7, #d9e7ff);
}

#app-container {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    text-align: center;
    overflow: hidden;
    position: relative;
    min-height: 500px;
}

.header-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

h1, h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.subtitle {
    color: #666;
    margin-bottom: 25px;
}

/* טיפול במעברי מסכים */
.screen {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

/* טפסים וכפתורים */
.input-group {
    margin-bottom: 20px;
    text-align: right;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.note {
    font-size: 0.8rem;
    color: #888;
    display: block;
    margin-top: 5px;
}

.error-msg {
    color: #d32f2f;
    font-size: 0.9rem;
    margin-top: 5px;
}

.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary { background-color: var(--primary-color); }
.btn.primary:hover { background-color: #45a049; }

.btn.secondary { background-color: var(--secondary-color); }
.btn.secondary:hover { background-color: #e68a00; }

.nav-btn {
    background-color: #f1f1f1;
    color: #333;
    margin-top: 10px;
    padding: 10px;
    font-size: 1rem;
}
.nav-btn:hover { background-color: #ddd; }

.nav-buttons-bottom {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

/* אזור תוצאות */
.result-box {
    background: #f9f9f9;
    border: 2px dashed var(--primary-color);
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
}

.result-number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.result-text {
    font-size: 1.5rem;
    color: #555;
}

/* רשימת תוצאות - מסך 3 */
.result-item {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    border: 1px solid #eee;
}

/* תוצאה קיימת במאגר - ירוק */
.exact-match {
    background-color: #e8f5e9;
    color: var(--green-result);
    border-color: var(--green-result);
}

/* תוצאה מורכבת - כחול */
.generated-match {
    background-color: #e3f2fd;
    color: var(--blue-result);
    border-color: var(--blue-result);
}

/* הדגשת מילת החובה בתוך הביטוי */
.highlight-word {
    background-color: rgba(255, 255, 255, 0.6);
    padding: 0 5px;
    border-radius: 4px;
    text-decoration: underline;
    font-weight: 800;
}

/* כפתורי שיתוף */
.share-container {
    margin-top: 25px;
}

.share-btn {
    display: block;
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    margin-bottom: 10px;
}

.share-btn.wa { background-color: #25D366; }
.share-btn.email { background-color: #1976D2; }

#loading {
    color: var(--primary-color);
    font-weight: bold;
    margin: 15px 0;
}