/* ===== בסיס ===== */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f9;
}

/* ===== כותרות ===== */
h2 {
    text-align: center;
}

/* ===== קונטיינר ===== */
.container {
    max-width: 800px;
    margin: auto;
    padding: 20px;
}

/* ===== כרטיסים ===== */
.card, .question, .container-box {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* ===== כפתורים ===== */
.btn, button {
    padding: 10px 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover, button:hover {
    background: #2980b9;
}

/* ===== טפסים ===== */
input, select {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
}

/* ===============================
   RESET
================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* ===============================
   APP LAYOUT
================================ */
.app {
    display: flex;
    min-height: 100vh;
    background: #f4f6f9;
}
.card {
    transition: 0.2s;
}

.card:hover {
    transform: scale(1.02);
}

.card {
    overflow: visible !important;
}

input[type="file"] {
    position: relative;
    z-index: 10;
}




/* ===============================
   SIDEBAR
================================ */
.sidebar {
    width: 220px;
    background: #1e293b;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar .logo {
    margin-bottom: 20px;
}

.sidebar a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    transition: 0.3s;
}

.sidebar a:hover {
    background: #334155;
    color: white;
}

/* ===============================
   MAIN
================================ */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===============================
   TOPBAR
================================ */
.topbar {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

/* ===============================
   CONTENT
================================ */
.content {
    padding: 20px;
}

/* ===============================
   CARDS
================================ */
.card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* ===============================
   FORMS
================================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

input, textarea, select {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-top: 5px;
}

/* ===============================
   BUTTONS
================================ */
.btn {
    background: #2563eb;
    color: white;
    padding: 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    background: #1d4ed8;
}

/* ===============================
   QUESTIONS
================================ */
.question {
    margin-bottom: 15px;
}

/* ===============================
   Floating Timer
================================ */
#timer.floating-timer {
    position: fixed !important;
    top: 80px !important;        /* מתחת ל-header */
    right: 20px !important;

    background: #1e293b;
    color: #fff;

    padding: 12px 18px;
    border-radius: 10px;

    font-size: 18px;
    font-weight: bold;

    box-shadow: 0 4px 12px rgba(0,0,0,0.3);

    z-index: 9999 !important;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 768px) {

    .app {
        flex-direction: column;
    }

    .sidebar {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
    }

    .sidebar a {
        flex: 1;
        text-align: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== LOGIN ===== */
.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 300px;
    text-align: center;
}

body.login-page {
    background: linear-gradient(135deg, #2980b9, #6dd5fa);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.error {
    color: red;
}

/* ===== ADMIN ===== */
.navbar {
    height: 60px;
    background: #2c3e50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.layout {
    display: flex;
    height: calc(100vh - 60px);
}

.sidebar {
    width: 220px;
    background: #34495e;
    color: white;
    padding: 15px;
}

.sidebar a {
    display: block;
    padding: 10px;
    color: white;
    text-decoration: none;
}

.sidebar a:hover {
    background: #2c3e50;
}

/* ===== טבלאות ===== */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

th {
    background: #2c3e50;
    color: white;
}

/* ===== כפתורי מחיקה ===== */
.delete-btn {
    margin-top: 10px;
    padding: 10px;
    background: #e74c3c;
    color: white;
    border: none;
}

/* ===== כפתור חזרה ===== */
.back-btn {
    display: inline-block;
    margin-bottom: 15px;
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

/* ===== טיימר ===== */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* ===============================
   GLOBAL RESPONSIVE
================================ */

* {
    box-sizing: border-box;
}

img, canvas {
    max-width: 100%;
    height: auto;
}

/* ===============================
   CONTAINER
================================ */
.container {
    width: 100%;
    max-width: 1000px;
    margin: auto;
    padding: 15px;
}

/* ===============================
   LAYOUT
================================ */
.layout {
    display: flex;
    gap: 20px;
}

.sidebar {
    min-width: 200px;
}

.content {
    flex: 1;
}

/* ===============================
   FORMS
================================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    width: 100%;
}

/* ===============================
   BUTTONS
================================ */
.btn {
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    display: inline-block;
}

/* ===============================
   MOBILE (CRITICAL)
================================ */
@media (max-width: 768px) {

    /* layout הופך לעמודה */
    .layout {
        flex-direction: column;
    }

    /* sidebar למעלה */
    .sidebar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .sidebar a {
        flex: 1;
        text-align: center;
    }

    /* טפסים לעמודה אחת */
    .form-grid {
        grid-template-columns: 1fr;
    }

    /* כפתורים מלאים */
    .btn {
        width: 100%;
    }

    /* כותרות */
    h2 {
        font-size: 20px;
        text-align: center;
    }

    /* כרטיסים */
    .card {
        padding: 15px;
    }

    /* שאלות במבחן */
    .question {
        padding: 15px;
    }
}

/* ===============================
   SMALL MOBILE
================================ */
@media (max-width: 480px) {

    body {
        font-size: 14px;
    }

    h2 {
        font-size: 18px;
    }

    .btn {
        padding: 12px;
    }
}
