/* /css/standard-documents.css */

:root {
    --primary-blue: #0066cc;
    --primary-orange: #ff6600;
    --text-color: #333333;
    --hover-blue: #0052a3;
    --border-color: #eaeaea;
    --background-hover: #f8f9fa;
}

.standard-docs-section {
    margin: 2em 0;
    font-size: 0.8em;
}

.standard-docs-title {
    font-size: 1.5em;
    color: var(--text-color);
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--border-color);
}

.standard-docs-container {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.standard-docs-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.standard-docs-table th {
    background: var(--primary-blue);
    color: #ffffff;
    padding: 1em;
    text-align: left;
    font-weight: 500;
}

.standard-docs-table td {
    padding: 1em;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.standard-docs-table tr:last-child td {
    border-bottom: none;
}

.standard-docs-table tr:hover {
    background-color: var(--background-hover);
}

/* คอลัมน์เฉพาะ */
.column-file {
    width: 50%;
}

.column-date {
    width: 25%;
}

.column-download {
    width: 25%;
    text-align: right;
}

/* ไอคอนไฟล์ */
.file-icon {
    margin-right: 0.5em;
    opacity: 0.7;
    display: inline-block;
    vertical-align: middle;
}

/* ปุ่มดาวน์โหลด */
.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-orange);
    color: #ffffff;
    padding: 0.5em 1em;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.download-button:hover,
.download-button:focus {
    background: var(--hover-blue);
    text-decoration: none;
    color: #ffffff;
    transform: translateY(-1px);
}

.download-button:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.download-icon {
    margin-right: 0.5em;
}

/* ข้อความว่างเปล่า */
.standard-docs-empty {
    padding: 2em;
    text-align: center;
    background: var(--background-hover);
    border-radius: 8px;
    color: var(--text-color);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .standard-docs-table thead {
        display: none;
    }
    
    .standard-docs-table tr {
        display: flex;
        align-items: center;
        padding: 0.8em;
        border-bottom: 1px solid var(--border-color);
        background: #ffffff;
    }
    
    .standard-docs-table tr:last-child {
        border-bottom: none;
    }
    
    .standard-docs-table td {
        padding: 0;
        border: none;
        display: inline-flex;
        align-items: center;
    }
    
    /* ชื่อไฟล์ */
    .standard-docs-table td.column-file {
        flex: 1;
        min-width: 0;
        margin-right: 1em;
    }
    
    .column-file span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
        max-width: calc(100% - 1.5em);
    }
    
    /* วันที่ */
    .standard-docs-table td.column-date {
        display: none; /* ซ่อนวันที่บนมือถือเพื่อความกระชับ */
    }
    
    /* ปุ่มดาวน์โหลด */
    .standard-docs-table td.column-download {
        flex: 0 0 auto;
        margin-left: auto;
    }
    
    .download-button {
        padding: 0.4em 0.8em;
        font-size: 0.9em;
        min-width: auto;
    }
    
    /* ปรับขนาดปุ่มดาวน์โหลดให้กระชับ */
    .download-button .button-text {
        display: none;
    }
    
    .download-button .download-icon {
        margin: 0;
    }
    
    /* เพิ่ม hover state ที่ชัดเจนบนมือถือ */
    .standard-docs-table tr:active {
        background-color: var(--background-hover);
    }
}

/* High Contrast Mode Support */
@media (forced-colors: active) {
    .download-button {
        border: 2px solid currentColor;
    }
}