/* Base Styles */
:root {
    --primary-color: #4a6da7;
    --primary-dark: #3a5a8c;
    --secondary-color: #5cb85c;
    --secondary-dark: #4cae4c;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #ddd;
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --font-family-en: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-family-ar: 'Amiri', 'Traditional Arabic', serif;
}

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

body {
    font-family: var(--font-family-en);
    color: var(--text-color);
    background-color: var(--light-bg);
    line-height: 1.6;
}

/* Language specific styles */
html[dir="rtl"] body {
    font-family: var(--font-family-ar);
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header Styles */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.app-title {
    margin-bottom: 1rem;
    text-align: center;
    color: var(--primary-color);
}

/* Language Toggle */
.language-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

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

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Program Styles */
.program {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

.program-title {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-color);
}

.items-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .items-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Item Card Styles */
.item-card {
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.item-title {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.reset-button {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    transition: color 0.3s;
}

.reset-button:hover {
    color: #666;
}



.counter-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
}

.current-count {
    color: var(--primary-color);
}

.target-count {
    color: #777;
}

.count-button {
    padding: 1rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
    width: 100%;
    margin-top: auto;
}

.count-button:hover {
    background-color: var(--secondary-dark);
}

.count-button:active {
    transform: scale(0.98);
}

/* Language specific display */
html[dir="ltr"] .ar {
    display: none;
}

html[dir="rtl"] .en {
    display: none;
}

/* RTL specific adjustments */
html[dir="rtl"] .reset-button {
    transform: scaleX(-1);
}

/* Loading state */
.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: #777;
}

/* Progress bar inside button (optional enhancement) */
.progress-bar {
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: white;
    transition: width 0.3s ease;
}

/* Completed item styling */
.item-card.completed .count-button {
    background-color: #28a745;
}

.item-card.completed .counter-display {
    color: #28a745;
}

/* Font for Arabic text */
@font-face {
    font-family: 'Amiri';
    src: url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&display=swap');
}
