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

:root {
    --primary-green: #A8D5BA;
    --soft-cream: #F5F2E8;
    --calm-blue: #B4D4E1;
    --text-dark: #3A4A3D;
    --text-light: #6B7B6E;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --shadow-soft: 0 8px 32px rgba(31, 38, 135, 0.15);
    --gradient-bg: linear-gradient(135deg, #A8D5BA 0%, #B4D4E1 100%);
}

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

body {
    font-family: 'Heebo', sans-serif;
    background: var(--gradient-bg);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.2);
}

.header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.2;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-menu a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-green);
}

.logout-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #97c9a8;
    transform: translateY(-1px);
}

.main-content {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    font-size: 1rem;
    transition: all 0.3s ease;
    direction: rtl;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    background: rgba(255, 255, 255, 0.8);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-green);
    color: white;
}

.btn-primary:hover {
    background: #97c9a8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--calm-blue);
    color: white;
}

.btn-secondary:hover {
    background: #a3c9d6;
    transform: translateY(-1px);
}

.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-item:hover {
    background: rgba(255, 255, 255, 0.5);
}

.radio-item input[type="radio"] {
    accent-color: var(--primary-green);
}

.anxiety-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    -webkit-appearance: none;
    direction: rtl;
}

/* RTL support for range sliders */
input[type="range"] {
    direction: rtl;
}

/* Fix for webkit browsers to support RTL */
input[type="range"]::-webkit-slider-runnable-track {
    direction: rtl;
}

/* Additional RTL support for better slider behavior */
input[type="range"] {
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    -o-transform: rotateY(180deg);
    -ms-transform: rotateY(180deg);
    transform: rotateY(180deg);
}

.anxiety-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-green);
    cursor: pointer;
}

.anxiety-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-green);
    cursor: pointer;
    border: none;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    height: 80px;
    max-width: 120px;
    object-fit: contain;
    border-radius: 5px;
}

.login-card h1 {
    margin-bottom: 2rem;
    color: var(--text-dark);
    font-weight: 600;
}

.error-message {
    background: rgba(255, 107, 107, 0.2);
    color: #d63031;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.success-message {
    background: rgba(0, 184, 148, 0.2);
    color: #00b894;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 184, 148, 0.3);
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-green);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.stats-card {
    text-align: center;
    padding: 1.5rem;
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 0.5rem;
}

.stats-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .container {
        padding: 10px;
    }
    
    .glass-card {
        padding: 1.5rem;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .stats-number {
        font-size: 2rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .journey-map {
        min-height: 300px;
        touch-action: pan-x pan-y;
    }
    
    .station {
        touch-action: none;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.5rem 0;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .nav-menu {
        font-size: 0.9rem;
    }
    
    .glass-card {
        padding: 1rem;
        border-radius: 15px;
    }
    
    /* Additional mobile improvements for rewards */
    .rewards-grid {
        gap: 2rem;
        padding: 0 5px;
    }
    
    .rewards-grid .reward-card {
        margin: 0 0 1.5rem 0;
    }
    
    .reward-card {
        min-height: 250px;
    }
    
    .container {
        padding: 10px;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .stats-card {
        padding: 1rem;
    }
    
    .anxiety-slider {
        height: 10px;
    }
    
    .anxiety-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Rewards Grid Specific Styling */
.rewards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    max-width: 100%;
}

.rewards-grid .reward-card {
    flex: 1 1 300px;
    max-width: calc(50% - 1.25rem);
}

.reward-card {
    min-height: 320px;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.reward-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.25);
}

.reward-card.achieved {
    border: 2px solid var(--primary-green);
    background: linear-gradient(135deg, var(--glass-bg) 0%, rgba(168, 213, 186, 0.1) 100%);
}

.reward-card.locked {
    background: linear-gradient(135deg, 
        rgba(168, 213, 186, 0.15) 0%,
        rgba(180, 212, 225, 0.15) 50%, 
        rgba(245, 242, 232, 0.15) 100%);
    border: 2px solid rgba(168, 213, 186, 0.4);
    position: relative;
    overflow: hidden;
}

.reward-card.locked::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(168, 213, 186, 0.1) 50%, 
        transparent 70%);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

.reward-card.locked:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(168, 213, 186, 0.6);
    box-shadow: 
        0 8px 25px rgba(168, 213, 186, 0.2),
        0 4px 15px rgba(0, 0, 0, 0.1);
}

.reward-card.locked .reward-placeholder {
    background: linear-gradient(135deg, 
        var(--primary-green) 0%, 
        var(--calm-blue) 100%) !important;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.reward-card.locked h3 {
    color: var(--text-dark) !important;
    font-weight: 600;
}

.reward-card.locked .progress-bar {
    background: rgba(168, 213, 186, 0.2);
    border: 1px solid rgba(168, 213, 186, 0.3);
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.winner-crown-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    z-index: 10;
    text-align: center;
    min-width: 50px;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.crown-icon {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.winner-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: #8B4513;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.btn-small {
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.btn-edit {
    background: var(--calm-blue);
    color: white;
}

.btn-edit:hover {
    background: #a3c9d6;
    transform: scale(1.05);
}

.btn-delete {
    background: #ff7675;
    color: white;
}

.btn-delete:hover {
    background: #e55656;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .rewards-grid {
        display: flex;
        flex-direction: column;
        gap: 2.5rem;
        width: 100%;
        padding: 0 10px;
    }
    
    .rewards-grid .reward-card {
        flex: none;
        width: 100%;
        max-width: 100%;
        min-height: 280px;
        margin: 0 0 2rem 0;
    }
    
    .reward-card {
        min-height: 280px;
    }
    
    /* Reduce container padding on mobile */
    .container {
        padding: 15px;
    }
    
    /* Adjust glass card padding */
    .glass-card {
        padding: 1.5rem;
    }
    
    .winner-crown-badge {
        top: -8px;
        right: -8px;
        min-width: 40px;
        min-height: 40px;
        padding: 6px;
    }
    
    .crown-icon {
        font-size: 1rem;
    }
    
    .winner-text {
        font-size: 0.6rem;
    }
}