@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #E31E24;
    --dark: #1a1a1a;
    --gray: #666;
    --light-gray: #f5f5f5;
    --white: #ffffff;
    --border: #e0e0e0;
}

body {
    font-family: 'Kanit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--light-gray);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 3px solid var(--primary-red);
    padding: 25px 0;
    margin-bottom: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    height: 50px;
    width: auto;
}

.header-title {
    display: flex;
    flex-direction: column;
}

.header-title h1 {
    color: var(--dark);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.header-title p {
    color: var(--gray);
    font-size: 14px;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Kanit', sans-serif;
}

.btn-primary {
    background: var(--primary-red);
    color: var(--white);
}

.btn-primary:hover {
    background: #c41a1f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.3);
}

.btn-secondary {
    background: var(--white);
    color: var(--dark);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.btn-danger {
    background: var(--dark);
    color: var(--white);
}

.btn-danger:hover {
    background: #000;
}

.btn-success {
    background: var(--primary-red);
    color: var(--white);
}

.btn-success:hover {
    background: #c41a1f;
}

/* Announcements Grid */
.announcements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.announcement-card {
    background: var(--white);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    border-left: 4px solid var(--gray);
}

.announcement-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.announcement-card.priority-high {
    border-left-color: var(--primary-red);
}

.announcement-card.priority-normal {
    border-left-color: var(--gray);
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}

.announcement-number {
    background: var(--dark);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.announcement-category {
    background: var(--light-gray);
    color: var(--dark);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.announcement-category.priority-high {
    background: var(--primary-red);
    color: var(--white);
}

.announcement-title {
    color: var(--dark);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.announcement-content {
    color: var(--gray);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
    white-space: pre-wrap;
}

.announcement-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--gray);
}

.announcement-date {
    font-weight: 500;
}

.announcement-attachments {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--light-gray);
    border-radius: 6px;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.attachment-item:hover {
    background: var(--white);
    border-color: var(--primary-red);
}

.attachment-icon {
    font-size: 18px;
}

.attachment-info {
    flex: 1;
}

.attachment-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
}

.attachment-size {
    font-size: 12px;
    color: var(--gray);
}

/* Login Form */
.login-container {
    max-width: 420px;
    margin: 60px auto;
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    height: 60px;
    width: auto;
}

.login-container h2 {
    text-align: center;
    color: var(--dark);
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--dark);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Kanit', sans-serif;
    transition: border 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-red);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.error-message {
    background: #ffe5e5;
    color: var(--primary-red);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    border: 1px solid var(--primary-red);
}

.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    border: 1px solid #2e7d32;
}

/* Admin Panel */
.admin-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    color: var(--dark);
    font-size: 22px;
    font-weight: 700;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: var(--dark);
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* Loading & Empty States */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
    font-size: 16px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.empty-state h3 {
    color: var(--dark);
    font-size: 22px;
    margin-bottom: 10px;
    font-weight: 700;
}

.empty-state p {
    color: var(--gray);
    font-size: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .logo-container {
        flex-direction: column;
        text-align: center;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
    }
    
    .announcements-grid {
        grid-template-columns: 1fr;
    }
    
    .announcement-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .announcement-title {
        font-size: 18px;
    }
}

/* Utility */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 20px;
}

.mb-2 {
    margin-bottom: 20px;
}

/* Icon styles */
.icon {
    display: inline-block;
    font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

.attachment-icon {
    display: inline-block;
    font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}
