/**
 * File: assets/css/liff-main.css
 * Purpose: Main styles for LIFF application
 * Created: 2025-08-02
 */

/* ===================================================================
   Reset และ Base Styles
   =================================================================== */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

/* ===================================================================
   LINE Brand Colors
   =================================================================== */

:root {
    --line-green: #00c300;
    --line-green-dark: #00b300;
    --line-green-light: #e8f5e8;
    --primary-color: #00c300;
    --secondary-color: #666;
    --error-color: #ff4444;
    --warning-color: #ffaa00;
    --success-color: #00c300;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
}

/* ===================================================================
   Layout Components
   =================================================================== */

.container {
    max-width: 100%;
    padding: 0 16px;
    margin: 0 auto;
}

.header {
    background: var(--primary-color);
    color: white;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin: 0;
}

.content {
    padding: 20px 0;
    min-height: calc(100vh - 80px);
}

.footer {
    background: var(--card-bg);
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===================================================================
   Card Components
   =================================================================== */

.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: #fafafa;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: #fafafa;
}

/* ===================================================================
   Button Components
   =================================================================== */

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    line-height: 1.4;
    user-select: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--line-green-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

.btn-full {
    width: 100%;
    display: block;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    min-width: 80px;
}

/* ===================================================================
   Menu Components
   =================================================================== */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    padding: 20px 0;
}

.menu-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.menu-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: var(--text-primary);
}

.menu-icon {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.menu-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

/* ===================================================================
   Status Components
   =================================================================== */

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: var(--line-green-light);
    color: #006600;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.status-paid {
    background: var(--line-green-light);
    color: #006600;
}

.status-overdue {
    background: #f8d7da;
    color: #721c24;
}

/* ===================================================================
   Form Components  
   =================================================================== */

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

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 195, 0, 0.1);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    min-height: 100px;
}

/* ===================================================================
   Alert Components
   =================================================================== */

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: var(--line-green-light);
    color: #006600;
    border: 1px solid #b3e6b3;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===================================================================
   Loading Components
   =================================================================== */

.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================================================================
   Responsive Design
   =================================================================== */

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 15px;
    }
    
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .menu-item {
        padding: 20px 12px;
    }
    
    .header-title {
        font-size: 16px;
    }
}

/* ===================================================================
   Utility Classes
   =================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.hidden { display: none; }
.visible { display: block; }

.font-weight-normal { font-weight: 400; }
.font-weight-bold { font-weight: 600; }

.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-error { color: var(--error-color); }