@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;700&display=swap');

/* --- Font Import: Shabnam --- */
@font-face {
    font-family: 'Shabnam';
    src: url('fonts/Shabnam.eot');
    src: url('fonts/Shabnam.eot?#iefix') format('embedded-opentype'),
         url('fonts/Shabnam.woff2') format('woff2'),
         url('fonts/Shabnam.woff') format('woff'),
         url('fonts/Shabnam.ttf') format('truetype');
    font-weight: normal;
}

@font-face {
    font-family: 'Shabnam';
    src: url('fonts/Shabnam-Bold.eot');
    src: url('fonts/Shabnam-Bold.eot?#iefix') format('embedded-opentype'),
         url('fonts/Shabnam-Bold.woff2') format('woff2'),
         url('fonts/Shabnam-Bold.woff') format('woff'),
         url('fonts/Shabnam-Bold.ttf') format('truetype');
    font-weight: bold;
}

/* --- General & Global Styles --- */
body {
    direction: rtl;
    font-family: 'Shabnam', sans-serif;
    background: #0d1a26;
    color: #fff; /* Changed to white for better visibility */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    text-align: right;
}

/* Background Gradients & Effects */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 255, 128, 0.1), rgba(0, 0, 0, 0.1)), url('https://www.toptal.com/designers/subtlepatterns/patterns/dark-mosaic.png');
    animation: background-animate 10s infinite alternate;
    z-index: -1;
}

@keyframes background-animate {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Iran Flag Overlay */
.iran-flag {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 40px;
    background: linear-gradient(#14a04d 33.3%, white 33.3%, white 66.6%, #da0000 66.6%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 128, 0.5);
    z-index: 10;
}

/* --- Branding --- */
.logo-text {
    font-size: 2.5rem;
    color: #00ff80;
    text-shadow: 0 0 10px #00ff80;
    margin: 0;
}

.slogan-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

/* --- Login Box --- */
.login-container {
    perspective: 1000px;
    max-width: 90%;
}

.login-box {
    background: rgba(13, 26, 38, 0.8);
    border: 1px solid #00ff80;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 0 30px rgba(0, 255, 128, 0.5);
    width: 400px;
    transform: rotateY(10deg);
    transition: transform 0.5s;
}

.login-box:hover {
    transform: rotateY(0deg);
}

.btn-login {
    background: #00ff80;
    color: #0d1a26;
    font-weight: bold;
    border: none;
    transition: all 0.3s ease;
    padding: 12px;
}

.btn-login:hover {
    background: #00cc66;
    box-shadow: 0 0 20px rgba(0, 255, 128, 0.8);
    transform: scale(1.05);
}

/* --- Dashboard & Action Buttons (Responsive) --- */
.dashboard-container {
    width: 100%;
    max-width: 95%;
    padding: 20px;
    background: rgba(13, 26, 38, 0.8);
    border: 1px solid #00ff80;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 255, 128, 0.5);
    text-align: center;
    box-sizing: border-box;
}

.dashboard-title {
    color: #fff;
    font-size: 2.5rem;
    text-shadow: 0 0 10px #fff;
}

.dashboard-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    margin-bottom: 40px;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.btn-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 150px;
    background: #0d1a26;
    border: 2px solid #00ff80;
    color: #00ff80;
    border-radius: 15px;
    font-weight: bold;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 128, 0.3);
    text-shadow: 0 0 5px #00ff80;
}

.btn-action:hover {
    background: #00ff80;
    color: #0d1a26;
    box-shadow: 0 0 30px rgba(0, 255, 128, 0.8);
    transform: scale(1.05) translateY(-5px);
}

.btn-action i {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* --- General Styles for Inquiry Pages --- */
.inquiry-container, .result-box, .result-container {
    width: 100%;
    max-width: 800px;
    padding: 30px;
    background: rgba(13, 26, 38, 0.8);
    border: 1px solid #00ff80;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 255, 128, 0.5);
    margin-top: 50px;
    margin-bottom: 50px;
    box-sizing: border-box;
}

/* --- Form Elements for Inquiry Pages --- */
.form-label {
    color: #00ff80;
    font-size: 0.9rem;
}
.form-control, .form-select {
    background: #081118;
    border: 1px solid #00ff80;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 255, 128, 0.3);
    direction: rtl; /* Ensure RTL for all form controls */
    text-align: right;
}

.form-control:focus, .form-select:focus {
    background: #14283d;
    border-color: #00ff80;
    box-shadow: 0 0 15px rgba(0, 255, 128, 0.7);
}

/* Fix for File Input Direction */
.form-control[type="file"] {
    direction: ltr;
}

/* --- Result Box Specific Styles --- */
.result-box h2 {
    text-align: center;
}
.result-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
    padding: 8px 0;
}
.result-item-label {
    color: rgba(255, 255, 255, 0.7);
}
.result-item-value {
    font-weight: bold;
    color: #00ff80;
}
.status-record {
    color: #ff4d4d;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 0 0 5px #ff4d4d;
}
.status-no-record {
    color: #00ff80;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 0 0 5px #00ff80;
}

/* --- Inquiry Plate Form --- */
.plate-form-container {
    direction: ltr; /* Ensure the order of plate fields is LTR */
    gap: 10px;
}
.plate-box-part {
    flex-grow: 1;
    text-align: center;
    min-width: 80px;
    max-width: 120px;
}
.plate-input, .plate-select {
    background: #081118;
    border: 1px solid #00ff80;
    color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 255, 128, 0.3);
    text-align: center;
    font-size: 1.2rem;
    padding: 8px;
    height: 50px;
    direction: ltr; /* Ensure LTR direction for plate inputs */
}

.plate-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2300ff80' class='bi bi-caret-down-fill' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right 10px center;
    background-color: #081118;
}

/* --- Message Box --- */
.message-box {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 300px;
}

/* --- Responsive Breakpoints --- */
@media (max-width: 768px) {
    .action-buttons {
        grid-template-columns: 1fr;
    }
    .dashboard-title {
        font-size: 2rem;
    }
    .inquiry-container, .result-box, .result-container {
        padding: 20px;
    }
}
@media (max-width: 576px) {
    .plate-form-container {
        flex-direction: column;
    }
    .plate-box-part {
        width: 100%;
        max-width: 100%;
        margin-bottom: 10px;
    }
}