/**
 * PATH: /liff/assets/css/liff-style.css
 * The Palm City Hill - LIFF Styles
 * Version: 3.0.0
 * Description: CSS สำหรับ LIFF Application
 */

/* ========================================
   BASE RESET & VARIABLES
   ======================================== */
:root {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #d1fae5;
    --secondary: #3b82f6;
    --secondary-light: #dbeafe;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --success: #10b981;
    --text-dark: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
}

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

body {
    font-family: 'Prompt', sans-serif;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========================================
   CONTAINER
   ======================================== */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ========================================
   HEADER
   ======================================== */
.header {
    text-align: center;
    padding: 30px 0;
}

.header-icon {
    font-size: 56px;
    margin-bottom: 12px;
}

.header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.header p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ========================================
   USER INFO
   ======================================== */
.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.user-info.show {
    opacity: 1;
    transform: translateY(0);
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status {
    font-size: 13px;
    color: var(--text-muted);
}

/* ========================================
   QUICK STATS
   ======================================== */
.quick-stats {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.quick-stats.show {
    opacity: 1;
    transform: translateY(0);
}

.quick-stats h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    text-align: center;
    padding: 16px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
}

.stat-card.stat-pending {
    background: var(--warning-light);
}

.stat-card.stat-approved {
    background: var(--primary-light);
}

.stat-card.stat-rejected {
    background: var(--danger-light);
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-pending .stat-number {
    color: var(--warning);
}

.stat-approved .stat-number {
    color: var(--primary);
}

.stat-rejected .stat-number {
    color: var(--danger);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========================================
   MENU GRID
   ======================================== */
.menu-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.menu-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.menu-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.menu-card:active {
    transform: scale(0.98);
}

.menu-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.menu-icon.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.menu-icon.secondary {
    background: var(--secondary-light);
    color: var(--secondary);
}

.menu-content {
    flex: 1;
    min-width: 0;
}

.menu-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.menu-description {
    font-size: 13px;
    color: var(--text-muted);
}

.menu-arrow {
    color: var(--text-muted);
    font-size: 14px;
}

/* ========================================
   LOADING
   ======================================== */
.loading {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: var(--text-muted);
}

/* ========================================
   ERROR MESSAGE
   ======================================== */
.error-message {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--danger-light);
    border: 1px solid var(--danger);
    color: #991b1b;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin: 20px 0;
}

.error-message i {
    font-size: 20px;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.form-section {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title i {
    color: var(--primary);
}

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

.form-group:last-child {
    margin-bottom: 0;
}

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

.form-label .required {
    color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Prompt', sans-serif;
    font-size: 15px;
    transition: all 0.2s ease;
    background: var(--bg-white);
}

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

.form-input:disabled,
.form-select:disabled {
    background: var(--bg-light);
    cursor: not-allowed;
}

.form-input.error {
    border-color: var(--danger);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 6px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Prompt', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

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

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

.btn-block {
    width: 100%;
}

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

/* ========================================
   FILE UPLOAD
   ======================================== */
.file-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-upload:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-upload.has-file {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-upload-icon {
    font-size: 32px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.file-upload-text {
    font-size: 14px;
    color: var(--text-muted);
}

.file-upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.file-preview {
    margin-top: 16px;
}

.file-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

/* ========================================
   STEPPER
   ======================================== */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: var(--primary);
    color: white;
}

.step.completed .step-number {
    background: var(--primary-light);
    color: var(--primary);
}

.step-line {
    width: 40px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
}

.step-line.active {
    background: var(--primary);
}

/* ========================================
   ROLE SELECTION
   ======================================== */
.role-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.role-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.role-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.role-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.role-option input {
    display: none;
}

.role-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.role-option.selected .role-icon {
    background: var(--primary);
    color: white;
}

.role-info {
    flex: 1;
}

.role-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.role-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================
   HOUSE INFO CARD
   ======================================== */
.house-info-card {
    background: var(--primary-light);
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.house-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.house-info-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.house-info-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
}

.house-info-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.house-info-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.house-detail-item {
    font-size: 13px;
}

.house-detail-label {
    color: var(--text-muted);
}

.house-detail-value {
    font-weight: 600;
    color: var(--text-dark);
}

/* ========================================
   SUCCESS SCREEN
   ======================================== */
.success-screen {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 24px;
}

.success-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.success-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ========================================
   REGISTRATION LIST
   ======================================== */
.registration-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.registration-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

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

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

.registration-date {
    font-size: 12px;
    color: var(--text-muted);
}

.registration-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.registration-status.pending {
    background: var(--warning-light);
    color: #92400e;
}

.registration-status.approved {
    background: var(--primary-light);
    color: #065f46;
}

.registration-status.rejected {
    background: var(--danger-light);
    color: #991b1b;
}

.registration-details {
    font-size: 13px;
    color: var(--text-muted);
}

.registration-note {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.registration-note strong {
    color: var(--text-dark);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 400px) {
    .container {
        padding: 16px;
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .house-info-details {
        grid-template-columns: 1fr;
    }
}
