/* =====================================
   TDrive - Road Safety
===================================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Cairo',sans-serif;
}

html{
    scroll-behavior:smooth;
}

body{
    background:#f8fbfc;
    color:#333;
    line-height:1.8;
}

/* ==========================
   Header
========================== */

header{
    position:sticky;
    top:0;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:20px 8%;
    background:#fff;
    box-shadow:0 8px 25px rgba(0,0,0,.05);
    z-index:999;
}

.logo{
    text-align:center;
}

.logo h1{
    font-size:34px;
    font-weight:800;
    color:#65b7c3;
}

.logo p{
    color:#888;
    font-size:15px;
}

nav{
    display:flex;
    gap:28px;
}

nav a{
    text-decoration:none;
    color:#333;
    font-weight:700;
    transition:.3s;
}

nav a:hover,
nav a.active{
    color:#65b7c3;
}

/* ==========================
   Hero
========================== */

.hero{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;

    padding:40px 20px 30px;
}

.hero-logo{
    display:flex;
    justify-content:center;
    margin-bottom:20px;
}


.hero h1{
    font-size:40px;
    font-weight:800;
    color:#333;
    margin:10px 0 15px;
}

.hero p{
    max-width:700px;
    margin:auto;
    font-size:18px;
    color:#666;
    line-height:1.8;
}

.button{
    display:inline-block;
    margin-top:35px;
    padding:15px 40px;
    background:#65b7c3;
    color:#fff;
    text-decoration:none;
    border-radius:14px;
    font-weight:bold;
    transition:.3s;
}

.button:hover{
    transform:translateY(-4px);
    box-shadow:0 10px 25px rgba(0,0,0,.12);
}
/* ==========================
   Topics
========================== */

section{
    padding:70px 8%;
}

section > h2{
    position: relative;
    display: table;
    margin: 0 auto 55px;
    padding-bottom: 18px;
    font-size: clamp(2rem, 5vw, 2.6rem);
    font-weight: 800;
    color: #2f2f2f;
    text-align: center;
}

section > h2::after{
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 90px;
    height: 5px;
    background: linear-gradient(90deg,#56c5d0,#9dddea);
    border-radius: 50px;
}

.cards-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
    gap:25px;
}

.card{
    display:block;
    text-decoration:none;
    background:#fff;
    border:2px solid #d9edf5;
    border-radius:22px;
    padding:30px;
    text-align:center;
    transition:.35s;
    color:#333;
    box-shadow:0 8px 20px rgba(0,0,0,.05);
}

.card:hover{
    transform:translateY(-8px);
    box-shadow:0 18px 35px rgba(0,0,0,.12);
}

.card .icon{
    display:flex;
    justify-content:center;
    align-items:center;
    margin-bottom:20px;
}

.card .icon img{
    width:120px;
    height:120px;
    object-fit:contain;
    transition:.3s;
}

.card:hover .icon img{
    transform:scale(1.08);
}

.card h3{
    color:#65b7c3;
    font-size:24px;
    margin-bottom:15px;
}

.card p{
    color:#666;
    font-size:17px;
    line-height:1.9;
}

/* ==========================
   Footer
========================== */

footer{
    margin-top:70px;
    padding:35px;
    background:#1f2937;
    color:#fff;
    text-align:center;
}

/* ==========================
   Responsive
========================== */

@media(max-width:900px){

    header{
        flex-direction:column;
        gap:20px;
        padding:20px;
    }

    nav{
        flex-wrap:wrap;
        justify-content:center;
    }

    .hero{
        padding:60px 25px;
    }

    .hero h1{
        font-size:38px;
    }

    .hero p{
        font-size:18px;
    }

}

@media(max-width:600px){

    section{
        padding:55px 20px;
    }

    .hero-icon{
        font-size:70px;
    }

    .hero h1{
        font-size:30px;
    }

    .hero p{
        font-size:17px;
    }

    .button{
        width:100%;
        text-align:center;
    }

}
/* ==========================
   Traffic Points Table
========================== */

.traffic-table{
    width:100%;
    border-collapse:collapse;
    margin-top:20px;
    background:#fff;
    border-radius:16px;
    overflow:hidden;
}

.traffic-table th{
    background:#65b7c3;
    color:#fff;
    padding:16px;
    font-size:18px;
}

.traffic-table td{
    padding:14px 16px;
    border-bottom:1px solid #ececec;
    font-size:16px;
}

.traffic-table tbody tr:nth-child(even){
    background:#f8fbfc;
}

.traffic-table tbody tr:hover{
    background:#eef8fa;
}

.traffic-table td:last-child{
    text-align:center;
    width:120px;
}

/* ألوان النقاط */

.points{
    display:inline-block;
    min-width:48px;
    padding:6px 12px;
    border-radius:20px;
    color:#fff;
    font-weight:700;
    text-align:center;
}

.p24{
    background:#d32f2f;
}

.p12{
    background:#f57c00;
}

.p8{
    background:#fbc02d;
    color:#333;
}

.p6{
    background:#1976d2;
}

.p4{
    background:#43a047;
}

.p2{
    background:#757575;
}

/* Responsive */

@media(max-width:768px){

    .traffic-table th,
    .traffic-table td{

        padding:10px;
        font-size:14px;

    }

    .points{

        min-width:40px;
        font-size:14px;

    }

}
/* ===============================
   Traffic Signs Slider
================================= */

.signs-slider{

    display:flex;
    gap:18px;

    margin:20px 0;

    overflow-x:auto;
    overflow-y:hidden;

    scroll-behavior:smooth;
    scroll-snap-type:x mandatory;

    padding-bottom:10px;

}

.signs-slider::-webkit-scrollbar{

    height:6px;

}

.signs-slider::-webkit-scrollbar-thumb{

    background:#7dc7d9;
    border-radius:20px;

}

.mini-sign{

    flex: 0 0 130px;

    background:#fff;

    border-radius:18px;

    padding:12px;

    text-align:center;

    scroll-snap-align:center;

    box-shadow:0 4px 12px rgba(0,0,0,.08);

    transition:.3s;

}

.mini-sign:hover{

    transform:translateY(-5px);

}

.mini-sign svg{

    width:95px;
    height:95px;

}

.mini-sign span{

    display:block;

    margin-top:10px;

    font-size:14px;

    font-weight:700;

    color:#1a3a5c;

}

.divider{
    width:35%;
    margin:20px auto;
    border:0;
    border-top:2px solid #d9edf5;
}


/* أيقونات الصفحات الداخلية */
.hero-logo img{
    width:170px;
    max-width:65%;
    height:auto;
}
.main-logo img {
    width: 380px;        /* تم تكبيره ليكون أكبر من حجمه الأصلي وأوضح */
    max-width: 95%;
    height: auto;
    display: block;
    margin: -10px auto 5px; /* رفعناه قليلاً للأعلى لتقليص أي مسافة إضافية */
}

/* ==========================
   Tips Section
========================== */
.tips-section {
    background: #ffffff;
    border-radius: 22px;
    padding: 40px;
    margin: 20px 8%;
    border: 2px solid #d9edf5;
    box-shadow: 0 8px 20px rgba(0,0,0,.05);
}

.tips-section h2 {
    color: #65b7c3;
    margin-bottom: 25px;
}

.tips-section ul {
    list-style: none;
    padding: 0;
}

.tips-section ul li {
    margin-bottom: 15px;
    padding-right: 30px;
    position: relative;
    font-size: 18px;
    color: #444;
}

/* إضافة أيقونة صغيرة بجانب كل نصيحة */
.tips-section ul li::before {
    content: "💡";
    position: absolute;
    right: 0;
    top: 0;
    font-size: 20px;
}
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* ===== صورة شرح إشارة المرور ===== */

.traffic-guide{
    text-align: center;
    margin: 35px auto;
}

.traffic-guide-img{
    width: 100%;
    max-width: 1000px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.traffic-list{
    max-width: 1000px;
    margin: 40px auto 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.traffic-item{
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    padding: 18px 22px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.num{
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.green{background:#2ecc71;}
.yellow{background:#f1c40f;color:#000;}
.red{background:#e74c3c;}
.purple{background:#8e44ad;}
.blue{background:#3498db;}

.traffic-item p{
    margin: 0;
    font-size: 17px;
    line-height: 1.8;
}
.hero-car{
    width: 220px;
    height: auto;
    display: block;
    margin: 0 auto 25px;
}
