body{
    margin:0;
    font-family:Segoe UI, Tahoma, sans-serif;
    background: linear-gradient(135deg, #e0e7ff, #f4f4f4);
    display:flex;
    justify-content:center;
    align-items:center;
    min-height:100vh;
    padding-bottom: 80px;

}
/* =========================
   HEADER
========================= */
.header {
    width: 100%;
    background: linear-gradient(135deg, #0062ff, #7c3aed);
    color: white;

    display: flex;
    justify-content: center;   /* 👈 وسط افقی */
    align-items: center;       /* 👈 وسط عمودی */

    gap: 30px;                 /* فاصله بین آیتم‌ها */

    padding: 15px 40px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.header .logo {
    font-size: 20px;
    font-weight: bold;
}

.header nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    font-size: 16px;
    transition: 0.3s;
}

.header nav a:hover {
    color: #ffeb3b;
}
/* کارت اصلی */
.box{
    width: 750px;
    height: 500px;          /* 👈 ارتفاع ثابت */
    background: white;
    padding: 20px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;       /* 👈 جلوگیری از بیرون زدن */
}

/* لغت */
h1#word{
    color:#3d88ff;
    font-size: 30px;
    text-align: center;
    margin: 0;
    padding: 20px;
}

/* Parts of speech */
h2#meaning{
    font-size: 18px;
    font-weight: bold;
    color:#2189ff;
    background: #e5ebff;
    padding: 15px;
    border-radius: 8px;
    margin: 0;
    text-align: center;
}
/* تعریف لغات*/
p#definition{
    font-size: 20px;
    font-weight: bold;
    height: 60px; /* 👈 ارتفاع ثابت */
    color:#00aaff;
    background: #fbf9fa;
    padding: 15px;
    border-top: 2px solid #a0c4ff;
    border-right: 2px solid #a0c4ff;
    border-radius: 8px;
    
    
}
/* مثال‌ها */
p#example{
    font-size: 16px;
    font-weight: 500;
    color:#6370ff;
    line-height: 25px;
    height: 200px; /* 👈 ارتفاع ثابت */
    background: #f9fafb;
    padding: 10px;
    border-left: 2px solid #a0c4ff;
    border-bottom: 2px solid #a0c4ff;
    border-radius: 8px;
    flex: 1; /* 👈 فضای باقی را بگیرد */
}

/* دکمه‌ها */
.buttons{
    display:flex;
    justify-content:center;
    margin-top: 10px;
}

/* دکمه */
button{
    background:#0062ff;
    color:white;
    border:none;
    padding:10px 25px;
    border-radius:8px;
    font-size:16px;
    cursor:pointer;
    transition:.3s;
    width: 30%;  /* 👈 مشکل بزرگ شدن و بیرون زدن حل شد */
}

button:hover{
    background:#7c3aed;
}

input[type="file"]{
    display: none; /* 👈 input اصلی مخفی می‌شود */
}

/* دکمه انتخاب فایل */
.file-label{
    display: inline-block;
    background: linear-gradient(135deg, #0062ff, #7c3aed);
    color: white;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.3s;
    text-align: center;
    width: 30%;
    margin-bottom: 10px;
    align-self: center; /* 👈 وسط چین کردن */
}

/* hover effect */
.file-label:hover{
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* وقتی فایل انتخاب شد */
.file-label:active{
    transform: scale(0.98);
}
@media (max-width: 768px) {

    body {
        background: white; /* 👈 کل صفحه سفید */
    }

    .box {
        width: 100%;
        height: 100vh;   /* 👈 تمام صفحه موبایل */
        border-radius: 0; /* 👈 بدون گوشه */
        box-shadow: none; /* 👈 بدون سایه */
        padding: 15px;
    }
}