@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700&display=swap');

@font-face {
    font-family: 'Google Sans';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.gstatic.com/s/productsans/v5/HYvgU2fE2nRJvZ5JFAumwegdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
}
@font-face {
    font-family: 'Google Sans';
    font-style: normal;
    font-weight: 500;
    src: url(https://fonts.gstatic.com/s/productsans/v5/HYvwU2fE2nRJvZ5JFAumwegdm0NCKydO8-oayXSOefg.woff2) format('woff2');
}
@font-face {
    font-family: 'Google Sans';
    font-style: normal;
    font-weight: 700;
    src: url(https://fonts.gstatic.com/s/productsans/v5/HYvwU2fE2nRJvZ5JFAumwegdm0NCBGNO8-oayXSOefg.woff2) format('woff2');
}

:root {
    /* Colors from DESIGN.md */
    --surface: #f6fafe;
    --surface-dim: #d7dadf;
    --surface-bright: #f6fafe;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #f0f4f8;
    --surface-container: #ebeef3;
    --surface-container-high: #e5e8ed;
    --surface-container-highest: #dfe3e7;
    
    --on-surface: #181c1f;
    --on-surface-variant: #3f484f;
    --outline: #6f7880;
    
    --primary: #00658c;
    --on-primary: #ffffff;
    --primary-container: #3da5d9;
    --on-primary-container: #00374e;
    
    --secondary: #765b00;
    --secondary-container: #fece4b;
    --on-secondary-container: #725800;
    
    --error: #ba1a1a;
    --on-error: #ffffff;
    --error-container: #ffdad6;
    --on-error-container: #93000a;
    
    /* Added semantic success colors for completed status */
    --success: #198754;
    --success-container: #d1e7dd;
    --on-success-container: #0f5132;

    --background: #f6fafe;
    --on-background: #181c1f;
    
    /* Font override to Google Sans per user request */
    --font-family: 'Google Sans', 'Noto Sans Thai', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--on-background);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--surface-container-lowest);
    border-right: 1px solid var(--surface-container-high);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 32px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    background-color: var(--primary-container);
    color: var(--on-primary-container);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

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

.sidebar-title h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.sidebar-title span {
    font-size: 12px;
    color: var(--on-surface-variant);
    margin-top: 4px;
}

.sidebar-menu {
    list-style: none;
    padding: 0 16px;
    margin-top: 16px;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--on-surface-variant);
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.sidebar-menu a:hover {
    background-color: var(--surface-container);
}

.sidebar-menu a.active {
    background-color: var(--primary-container);
    color: var(--on-primary-container);
}

.sidebar-menu a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Main Area */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 72px;
    background-color: var(--surface-container-lowest);
    border-bottom: 1px solid var(--surface-container-high);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
}

.topbar-brand {
    font-weight: 600;
    color: var(--primary);
    font-size: 18px;
}

.topbar-actions {
    display: flex;
    gap: 24px;
    align-items: center;
    color: var(--primary);
    font-size: 20px;
}

.topbar-actions i {
    cursor: pointer;
    transition: color 0.2s;
}

.topbar-actions i:hover {
    color: var(--on-surface-variant);
}

.notification-icon {
    position: relative;
}

.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: var(--secondary-container);
    border-radius: 50%;
    border: 2px solid var(--surface-container-lowest);
}

/* Content */
.content {
    padding: 48px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--on-surface-variant);
    margin-bottom: 48px;
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.action-card {
    background-color: var(--surface-container-lowest);
    border-radius: 1rem;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--surface-container-highest);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.06);
}

.action-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--surface);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.action-card span {
    font-weight: 600;
    font-size: 16px;
    color: var(--on-surface);
}

/* Petition History */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--surface-container);
    padding-bottom: 16px;
}

.section-header h2 {
    font-size: 20px;
    color: var(--primary);
    font-weight: 700;
}

.section-header a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.petition-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.petition-card {
    background-color: var(--surface-container-lowest);
    border-radius: 1rem;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--surface-container-highest);
    border-left-width: 6px;
}

.petition-card.status-waiting {
    border-left-color: var(--error);
}

.petition-card.status-progress {
    border-left-color: var(--secondary-container);
}

.petition-card.status-resolved {
    border-left-color: var(--success);
}

.petition-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.petition-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.req-number {
    color: var(--outline);
    font-size: 14px;
}

.petition-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--on-surface);
}

.petition-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--on-surface-variant);
    font-size: 14px;
}

.petition-meta i {
    color: var(--outline);
}

.petition-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.petition-date {
    font-size: 14px;
    color: var(--outline);
}

/* Status Chips */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
}

.chip-waiting {
    background-color: var(--error-container);
    color: var(--on-error-container);
}

.chip-progress {
    background-color: #ffdf94;
    color: #594400;
}

.chip-resolved {
    background-color: var(--success-container);
    color: var(--on-success-container);
}

/* Buttons */
.btn-outline {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
    padding: 8px 20px;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: var(--surface);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .quick-actions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--surface-container-high);
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 0 16px 16px;
        gap: 8px;
    }

    .sidebar-menu li {
        margin-bottom: 0;
        white-space: nowrap;
    }

    .topbar {
        padding: 0 24px;
    }

    .content {
        padding: 24px;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .petition-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .petition-actions {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .petition-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .btn-outline {
        width: 100%;
    }
}
