/*ver 11.0*/
:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --primary-light: #818CF8;
  --secondary: #3B82F6;
  --success: #10B981;
  --success-dark: #059669;
  --danger: #EF4444;
  --danger-dark: #DC2626;
  --warning: #F59E0B;
  --background: #F9FAFB;
  --surface: #FFFFFF;
  --text: #1F2937;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --border-dark: #D1D5DB;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --gradient-primary: linear-gradient(135deg, var(--primary), var(--secondary));
  --gradient-success: linear-gradient(135deg, var(--success), var(--success-dark));
  --gradient-danger: linear-gradient(135deg, var(--danger), var(--danger-dark));
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --transition: all 0.3s ease;
}

/* Base Styles */
body {
    font-family: 'Inter', 'Roboto', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
}

/* Typography */
h1 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 24px;
    text-align: center;
    margin: 2rem 0;
    font-weight: 700;
    animation: fadeInDown 0.5s ease-out;
}

h2 {
    color: var(--primary);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 1rem;
	text-align: center;
}


.close {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 12px;
    position: absolute;
    left: 10px;
    top: 10px;
    transition: var(--transition);
    border-radius: var(--radius);
}

.sentence-content p br {
    content: '';
    display: block;
    margin-bottom: 1rem; /* Adjust this value to control the spacing */
}

.close:hover {
    color: var(--text);
    background-color: var(--border);
}


/* Form Elements */
textarea, input[type="text"] {
    width: 90%;
    margin-bottom: 1rem;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: var(--transition);
}

textarea:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea {
    height: 100px;
    resize: vertical;
}

/* Buttons */
button {
    background: var(--gradient-primary);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

button:active {
    transform: translateY(0);
}

button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255,255,255,0), rgba(255,255,255,0.2));
    opacity: 0;
    transition: var(--transition);
}

button:hover::after {
    opacity: 1;
}


.correct {
    background-color: lightgreen !important;
    border-color: var(--success);
    animation: pulseGreen 0.3s ease;
}

.incorrect {
    background-color: lightcoral !important;
    border-color: var(--danger);
    animation: pulseRed 0.3s ease;
}


.test-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.test-item input {
    border: 1px solid var(--border);
    padding: 8px;
    margin: 0 5px;
    border-radius: var(--radius-sm);
    width: auto;
    display: inline-block;
    transition: var(--transition);
}

.test-item input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    width: 90%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.sticky-footer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    box-shadow: var(--shadow-xl);
    animation: bounceIn 0.5s ease;
	display: none;
}

#version-number {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Reveal Button */
.reveal-letter-btn {
    display: none;
    margin: 0 5px;
    background: var(--gradient-primary);
    font-size: 0.875rem;
    padding: 8px 16px;
}

.reveal-letter-btn.visible {
    display: inline-block;
    animation: fadeIn 0.2s ease;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--surface);
    margin: 15% auto;
    padding: 30px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.3s ease-out;
    position: relative;
}

/* Lists and Results */
#past-results, #saved-lists {
    width: calc(50% - 10px);
    height: 400px;
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 0 20px 20px 20px;
    position: relative;
    border: 1px solid var(--border);
    transition: var(--transition);
}

#past-results:hover, #saved-lists:hover {
    box-shadow: var(--shadow-lg);
}

#past-results h3, #saved-lists h3 {
    position: sticky;
    top: 0;
    background: var(--surface);
    margin: 0;
    padding: 20px 0 10px 0;
    border-bottom: 2px solid var(--primary);
    z-index: 10;
    font-weight: 600;
    color: var(--text);
}

.list-item, .result-item {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
    transition: var(--transition);
    border: 1px solid var(--border);
    animation: slideIn 0.3s ease-out;
}

.list-item:hover, .result-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.list-item p, .result-item p {
    margin: 8px 0;
    color: var(--text);
}

.list-item button, .result-item button {
    margin-top: 12px;
    margin-right: 8px;
}

.delete-btn {
    background: var(--gradient-danger);
}

.show-words-btn {
    background: var(--gradient-success);
}

/* Container */
.flex-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    width: 90%;
    margin-top: 30px;
}

/* Categories */
#categories-container, #subcategories-container {
    display: grid;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

#categories-container button, #subcategories-container button {
    padding: 12px 24px;
    font-size: 16px;
    background: var(--gradient-primary);
    transition: var(--transition);
}

/* Leaderboard */
#leaderboard {
    background: var(--surface);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    border: 1px solid var(--border);
    animation: fadeIn 0.5s ease;
    width: 100%; /* Ensure the container takes full width */
}

.leaderboard-scroll-container {
    width: 100%;
    overflow-x: auto;
    padding: 20px 0;
    margin: -20px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
    cursor: grab;
}

.leaderboard-scroll-container::-webkit-scrollbar {
    display: none;
}

.leaderboard-scroll-container:active {
    cursor: grabbing;
}

.leaderboard-section th,
.leaderboard-section td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
	text-align: center;
}

.leaderboard-section {
    flex: 0 0 100%; /* Change from 60% to 100% for desktop */
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
    scroll-snap-align: start;
    border: 1px solid var(--border);
    animation: slideIn 0.3s ease-out;
	margin-top: 20px;
}

.leaderboard-section table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 1;
}

/* Header */
.site-header {
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius-lg);
    margin-bottom: 30px;
    border: 1px solid var(--border);
    position: sticky;
    top: 1rem;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.site-logo img {
    width: 45px;
    height: 45px;
    border-radius: var(--radius);
    object-fit: cover;
}

.site-name {
    font-size: 24px;
    font-weight: bold;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    border: 2px solid var(--primary);
    transition: transform 0.2s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
}

.dropdown-content {
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 1000;
    left: 0;
    margin-top: 5px;
	display: none;
	position: absolute;
	top: 100%;
}


.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: right;
    transition: background-color 0.2s;
}

.dropdown-content.show {
  display: block;  /* Will be shown when .show class is added */
}

/* Loading States */
.loading-overlay {
			display: none;
			position: fixed;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			background-color: rgba(255, 255, 255, 0.8);
			z-index: 2000;
			justify-content: center;
			align-items: center;
		}

.loader {
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

/* Play Button */
.play-button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    transition: var(--transition);
}

.play-button:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow);
}

.play-button:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

/* Test Info */
.test-info {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 25px;
    text-align: center;
}

.test-info p {
    margin: 0;
    font-weight: 500;
    color: var(--primary);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% { transform: scale(0.9); }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulseGreen {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(-5px); }
}

/* Hover Effects */
.site-header:hover {
    box-shadow: var(--shadow-lg);
}

.dropdown-content a:hover {
    background-color: #f5f5f5;
}

.dropdown-content span {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

.test-item {
    direction: ltr;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    margin-bottom: 30px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* Content alignment within test items */
.sentence-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    text-align: left; /* Force left alignment for English content */
}

/* Play button positioning */
.play-button {
    margin-right: 15px;
    margin-left: 0;
    order: -1; /* Ensure it's always first */
}

/* Input and button alignment */
.test-item input[type="text"] {
    text-align: left;
    direction: ltr;
}

/* Original sentence text alignment */
span[id^="hint-"] {
    text-align: left;
    display: none;
}

span[id^="hint-"].visible {
    display: block !important;
    direction: ltr;
    margin: 8px 0;
}

.results-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.share-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-success) !important;
}

.share-button svg {
    width: 20px;
    height: 20px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.subscription-btn {
    background: var(--gradient-primary);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.subscription-modal-content {
    max-width: 600px;
}

.subscription-text {
    text-align: right;
    margin: 20px 0;
}

.subscription-text p {
    margin: 10px 0;
    line-height: 1.6;
}

.whatsapp-btn {
    background: #25D366;
    color: white;
    padding: 15px 30px;
    font-size: 18px;
    margin-top: 20px;
}

.popup {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgba(0,0,0,0.4);
    }
    .popup-content {
        background-color: #fefefe;
        margin: 15% auto;
        padding: 20px;
        border: 1px solid #888;
        width: 80%;
        max-width: 400px;
        border-radius: 8px;
        text-align: center;
        position: relative;
    }
   

    #google-signin-popup {
        background-color: #4285F4;
        color: white;
        padding: 10px 20px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 16px;
        margin-top: 20px;
    }
    #google-signin-popup:hover {
        background-color: #357ae8;
    }
	
	#load-predefined-list {
    padding: 15px 30px;
    font-size: 15px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
	
	#load-predefined-list {
        margin-top: 15px;  /* Add margin below the button */
    }
	
	.footer-content {
        padding: 10px;
    }
    
    .subscription-btn {
        width: 100%;
        text-align: center;
    }
	
	.results-buttons {
        flex-direction: column;
    }
    
    .share-button {
        margin-top: 10px;
    }
	
	.sticky-footer {
        width: 50%;
        left: 50%;
        transform: translateX(-50%);
        right: auto; /* Remove the right positioning */
		display: none;
    }


    .flex-container {
        flex-direction: column;
        margin-top: 20px;
    }

    #past-results, #saved-lists {
        width: 100%;
        margin-bottom: 20px;
    }

    .site-header {
        padding: 10px 15px;
    }

    .modal-content {
        width: 80%;
        margin: 5% auto;
        padding: 20px;
    }

    textarea {
        height: 80px;
    }

    .leaderboard-section {
        flex: 0 0 85%;
        padding: 15px;
		margin-top: 20px;
    }

    #leaderboard {
        padding: 0;
        width: 100%;
        margin: 0 auto;
    }

    #leaderboard table {
        width: 100%;
        margin: 0;
        table-layout: fixed;
    }

    #leaderboard th,
    #leaderboard td {
        padding: 8px;
        font-size: 14px;
        width: auto;
    }

    .leaderboard-scroll-container {
        width: 100%;
        margin: 0;
        padding: 0;
        overflow-x: auto;
    }

  
    button {
        width: 100%;
        margin-bottom: 10px;
    }

    .modal-content {
        max-height: 80vh;
        overflow-y: auto;
    }

    body.modal-open {
        position: fixed;
        width: 100%;
    }
	.modal-open {
        position: fixed;
        width: 100%;
        height: 100%;
    }

    .results-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .modal-content {
        position: relative;
        -webkit-overflow-scrolling: touch;
    }

    /* מניעת סקרול כשהמודל פתוח */
    html.modal-active,
    body.modal-active {
        overflow: hidden;
        position: fixed;
        height: 100%;
    }
	
	.sentence-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .sentence-content p {
        margin: 0.5rem 0;
        display: block;  /* Override previous flex settings */
    }
	
	
	
	.sentence-content span {
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .test-item {
        padding: 15px;
        flex-direction: row;
    }

    .reveal-letter-btn {
        padding: 5px 10px;
        font-size: 12px;
        height: 28px;
        margin: 0;
        width: auto;
    }

    .reveal-letter-btn.visible {
        display: inline-flex;
        align-items: center;
    }

    /* ביטול הסגנונות הכלליים לכפתורים במובייל עבור כפתור חשוף אות */
    .test-item .reveal-letter-btn {
        width: auto;
        margin-bottom: 0;
    }

    .test-item input {
        margin: 0 5px;
        padding: 5px;
    }
	
	.sentence-content {
        width: 100%;
    }
    
    /* Ensure hints stay hidden on mobile */
    span[id^="hint-"] {
        display: none !important;
    }
    
    /* Only show when explicitly made visible */
    span[id^="hint-"].visible {
        display: flex !important;
        align-items: center;
        gap: 5px;
        margin: 8px 0;
    }
    
    /* Container adjustments for better mobile layout */
    .test-item {
        flex-direction: column;
        padding: 15px;
    }
    
    .test-item > div {
        width: 100%;
    }
	
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Modern Section Enhancements */
.leaderboard-section th {
    background: rgba(79, 70, 229, 0.05);
    color: var(--text);
    font-weight: 600;
	text-align: center;
}

.leaderboard-section tr:hover {
    background: rgba(79, 70, 229, 0.05);
}

.start-test-btn {
    background: var(--gradient-primary);
    font-size: 14px;
    transition: var(--transition);
}

.start-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.difficulty-selector select {
    padding: 8px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.difficulty-selector select:hover {
    border-color: var(--primary);
}

.difficulty-selector select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* Focus States */
button:focus, 
input:focus, 
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Print Styles */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

.username-cell {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#leaderboard table td {
    max-width: 150px;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hamburger Menu Styles */
.hamburger-menu {
    position: relative;
    margin-left: 15px;
}

.hamburger-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    color: var(--text);
    background: var(--surface);
    border-radius: var(--radius);
    transition: var(--transition);
}

.hamburger-button:hover {
    background: var(--border);
    transform: none;
    box-shadow: none;
}

.menu-content {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    background: var(--surface);
    min-width: 200px;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    z-index: 1000;
}

.menu-content.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.menu-content a, .menu-item span {
    display: block;
    padding: 12px 15px;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    text-align: right;
}

.menu-content a:hover, .menu-item span:hover {
    background: var(--border);
}

.has-submenu {
    position: relative;
}

.arrow {
    border: solid var(--text);
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    margin-right: 5px;
    transition: transform 0.2s ease;
}

.arrow.down {
    transform: rotate(45deg);
    margin-bottom: 3px;
}

.arrow.up {
    transform: rotate(-135deg);
    margin-bottom: 0;
}

.submenu {
    display: none;
    background: var(--surface);
    padding: 5px 0;
}

.submenu.show {
    display: block;
}

.submenu a {
    padding-right: 25px;
}