/**
 * CSS สำหรับระบบป๊อปอัพแสดงรายละเอียดป้ายทะเบียน
 */

/* Modal Container */
.license-plate-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Content */
.license-plate-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Close Button */
.license-plate-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.license-plate-modal-close:hover,
.license-plate-modal-close:focus {
    color: #000;
}

/* Modal Body */
.license-plate-modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* License Plate Section */
.license-plate-modal-plate-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    border-radius: 10px;
}

/* Modal License Plate */
.license-plate-modal-plate {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 280px;
    height: 140px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 3px solid #000000;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    padding: 10px;
    position: relative;
}

.license-plate-modal-plate-inner {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.license-plate-modal-text {
    font-family: 'Peaktabien', 'Kanit', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    color: #000000;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0px;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* Modal Text Styling */
.license-plate-modal-text .thai-consonant {
    font-size: 1.1em;
    letter-spacing: -0.05em;
    vertical-align: middle;
    display: inline-block;
    font-weight: 900;
}

.license-plate-modal-text .number {
    font-size: 1.1em;
    letter-spacing: -0.05em;
    vertical-align: middle;
    display: inline-block;
    font-weight: 900;
}

.license-plate-modal-text .thai-vowel-upper,
.license-plate-modal-text .thai-tone {
    font-size: 0.8em;
    margin-left: -0.45em;
    position: relative;
    top: -0.85em;
    display: inline-block;
    width: 0;
    pointer-events: none;
    vertical-align: middle;
}

.license-plate-modal-text .thai-tone {
    top: -1.15em;
    margin-left: -0.4em;
}

.license-plate-modal-text .thai-vowel-lower {
    font-size: 0.8em;
    margin-left: -0.4em;
    position: relative;
    top: 0.25em;
    display: inline-block;
    width: 0;
    pointer-events: none;
    vertical-align: middle;
}

/* Details Section */
.license-plate-modal-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

/* Detail Row */
.license-plate-modal-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e8e8e8;
}

.license-plate-modal-detail-row:last-child {
    border-bottom: none;
}

/* Detail Label */
.license-plate-modal-label {
    font-weight: 600;
    color: #333;
    min-width: 120px;
    font-size: 0.95rem;
}

/* Detail Value */
.license-plate-modal-value {
    color: #666;
    font-size: 0.95rem;
    text-align: right;
    flex: 1;
    padding-left: 15px;
    word-break: break-word;
}

/* Background Classes for License Plates */
.license-plate-modal-plate.background-ขาวดำ {
    background-image: url('../shared_assets/white_black.webp') !important;
    background-size: cover !important;
    background-position: center !important;
    color: #000000 !important;
}

.license-plate-modal-plate.background-ทอง {
    background-image: url('../shared_assets/gold.webp') !important;
    background-size: cover !important;
    background-position: center !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

.license-plate-modal-plate.background-ฟ้า {
    background-image: url('../shared_assets/blue.webp') !important;
    background-size: cover !important;
    background-position: center !important;
    color: #000000 !important;
    border-color: #2196F3 !important;
}

.license-plate-modal-plate.background-เขียว {
    background-image: url('../shared_assets/green.webp') !important;
    background-size: cover !important;
    background-position: center !important;
    color: #000000 !important;
    border-color: #008000 !important;
}

.license-plate-modal-plate.background-ม่วง {
    background-image: url('../shared_assets/purple.webp') !important;
    background-size: cover !important;
    background-position: center !important;
    color: #000000 !important;
    border-color: #DDA0DD !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .license-plate-modal-content {
        width: 95%;
        padding: 20px;
        margin: 20% auto;
    }

    .license-plate-modal-plate {
        width: 240px;
        height: 120px;
    }

    .license-plate-modal-text {
        font-size: 2.5rem;
    }

    .license-plate-modal-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .license-plate-modal-label {
        min-width: auto;
    }

    .license-plate-modal-value {
        text-align: left;
        padding-left: 0;
    }
}

@media (max-width: 480px) {
    .license-plate-modal-content {
        width: 95%;
        padding: 15px;
        margin: 30% auto;
    }

    .license-plate-modal-plate {
        width: 200px;
        height: 100px;
    }

    .license-plate-modal-text {
        font-size: 2rem;
    }

    .license-plate-modal-details {
        padding: 15px;
        gap: 10px;
    }

    .license-plate-modal-label {
        font-size: 0.85rem;
    }

    .license-plate-modal-value {
        font-size: 0.85rem;
    }
}
