@font-face {
  font-family: "Aviny";
  src: url(fonts/Aviny.ttf);
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Aviny";
}

body {
    direction: rtl;
    background: #f4f4f4;
    
}

/* پس‌زمینه نرم پشت موبایل */
.soft-bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(145deg, #fff2e6,#e4e9cc);
    z-index: -2;
}

/* کارت موبایلی وسط صفحه */
.app-container {
    width: 390px;
    height: 780px;
    margin: 30px auto;
    border-radius: 32px;
    background: url("picture/BG.png") center/cover no-repeat;
    box-shadow: 0 20px 45px rgba(0,0,0,0.25);
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px 18px 80px; /* پایین بیشتر برای icon-buttons */
    overflow: hidden;
}

/* نمایش نام کاربر بالا */
.user-name-display {
    text-align: left;
    margin-bottom: 6px;
    font-size: 0.95rem;
    font-weight: 200;
    color: #31472b;
    text-shadow: 0 1px 2px rgba(255,255,255,0.9);
}


/* ===== آمار بالای صفحه ===== */
.top-bar {
    display: flex;
    justify-content: center; /* وسط */
    align-items: center;
    gap: 40px;               /* فاصله بین دو آمار */
    margin-bottom: 10px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ff5a3c;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.stat-icon {
    width: 28px;
    height: 28px;
}

/* ===== تایمر ===== */
.timer-section {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.timer-circle {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: breathe 3s ease-in-out infinite;
}

.progress-ring__circle-bg {
    opacity: 0.6;
}

.progress-ring__circle {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
    filter: drop-shadow(0 0 6px rgba(95, 72, 58, 0.5));
}

.time-text {
    position: absolute;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f3b23;
    text-shadow: 0 2px 4px rgba(255,255,255,0.8);
}

/* دکمه شروع/توقف */
.controls {
    margin-top: 1px;
}

.btn {
    border: none;
    border-radius: 99px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s;
}

.btn:active {
    transform: scale(0.96);
}

/* حالت‌های دکمه start/stop */
.btn.start {
    background: #37b26c;
    color: #fff;
    box-shadow: 0 6px 15px rgba(55,178,108,0.5);
}

.btn.stop {
    background: #ff3b30;
    color: #fff;
    box-shadow: 0 6px 15px rgba(255,59,48,0.5);
}
.btn:hover{
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
/* دکمه‌های استراحت */
.break-controls {
    display: flex;
    gap: 10px;
    margin-top: 13px;
}

.break-btn {
    flex: 1;
    background: rgba(138, 184, 188, 0);
    color: #8e8886;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.break-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
/* ===== تودو ===== */
.todo-section {
    flex: 1;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.11);
    border-radius: 20px;
    padding: 14px 14px 10px;
    box-shadow: 0 6px 18px rgba(255,255,255,0.8);
    overflow-y: auto;
}

.todo-section h2 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #19366b;
}

.todo-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

#todoText {
    flex: 1;
    border-radius: 12px;
    border: 1px solid #ffd0b3;
    padding: 8px 10px;
    font-size: 0.9rem;
}

#addTodo {
    width: 36px;
    border-radius: 12px;
    border: none;
    background: #31472b;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
}

#todoList {
    list-style: none;
}

#todoList li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff7f27d;
    padding: 6px 8px;
    border-radius: 10px;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

/* بخش چپ تسک: متن + delete */
.todo-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* چک‌باکس تسک */
.todo-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* متن تسک انجام شده */
.todo-done {
    text-decoration: line-through;
    color: #909b91;
}

/* دکمه حذف */
.todo-delete {
    cursor: pointer;
    color: #ff3b30;
    margin-right: 6px;
}

/* ===== آیکون‌باتن‌ها پایین ===== */
.icon-buttons {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    display: flex;
    justify-content: center;
    gap: 18px;
}

.icon-btn {
    border: none;
    background: rgba(255, 255, 255, 0.26);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s;
}

.icon-btn img {
    width: 50px;
    height: 50px;
}

/* دایره‌ای کردن */
.circle-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
}

.icon-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* ===== پاپ‌آپ موسیقی ===== */
.music-popup {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 320px;
    background: rgba(255,255,255,0.95);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.music-popup input {
    border-radius: 10px;
    border: 1px solid #ffd0b3;
    padding: 6px 8px;
    font-size: 0.85rem;
}

.music-popup button {
    border-radius: 10px;
    border: none;
    padding: 6px;
    background: #13275c;
    color: #fff;
    cursor: pointer;
}

.music-popup iframe {
    width: 100%;
    height: 350px;
    border-radius: 12px;
}

/* hidden برای پاپ‌آپ */
.hidden {
    display: none;
}

/* انیمیشن نفس کشیدن تایمر */
@keyframes breathe {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}



/* ---------------------------
   Leaderboard / Progress
--------------------------- */

.page-title{
    text-align:center;
    font-size:28px;
    margin-bottom:25px;
}

.list-container{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.list-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px 16px;
    border-radius:12px;
    background:rgba(255,255,255,0.05);
    backdrop-filter: blur(6px);
    font-size:16px;
}

.rank{
    font-weight:bold;
    width:30px;
}

.user{
    flex:1;
    text-align:left;
}

.tomatoes{
    font-weight:bold;
}

.minutes{
    opacity:0.8;
    font-size:14px;
}

.back-btn{
    margin-top:25px;
    width:100%;
}

/* Mobile view */

@media (max-width: 768px){
.app-container{
    width:100%;
    max-width:100%;
    height: 100%;
    max-height: 100%;
    border-radius:0;
    box-shadow:none;
}
}



/* contribution grid */

.contribution-grid{
display:grid;
grid-template-columns: repeat(7,1fr);
gap:6px;
margin-top:20px;
}

.day-box{
width:100%;
padding-top:100%;
border-radius:4px;
background:#1b1b1b;
position:relative;
}

.level-1{ background:#7ea9eb; }
.level-2{ background:#8edc9c; }
.level-3{ background:#82c28d; }
.level-4{ background:#507053; }

.streak-box{
margin-top:20px;
text-align:center;
font-size:20px;
font-weight:bold;
}
