/* Design System & Variables */
:root {
    --font-primary: 'Outfit', sans-serif;
    
    /* Light Mode Palette */
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --primary: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --accent: #0ea5e9;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-app: #0b0f19;
    --bg-card: #151f32;
    --bg-input: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #273549;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

/* Layout Container */
.app-container {
    width: 100%;
    max-width: 540px; /* Mobile focused max-width */
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 100vh;
}

/* Header styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
}

.app-header h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Theme Toggle Button */
.theme-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.theme-btn:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

.theme-btn svg {
    width: 20px;
    height: 20px;
}

/* Toggle light/dark icon visibility */
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
.sun-icon { display: none; }
.moon-icon { display: block; }

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

/* Card Base */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

/* Search Card specific */
.search-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.search-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.45;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 500;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    color: var(--text-main);
    transition: all var(--transition-fast);
    outline: none;
    text-align: center;
    letter-spacing: 0.05em;
}

.input-group input:focus {
    border-color: var(--primary);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-glow);
}

.input-group input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: normal;
}

.input-group button {
    width: 100%;
    padding: 14px;
    background: var(--primary-gradient);
    color: white;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-glow);
    transition: all var(--transition-fast);
}

.input-group button:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

.input-group button:active {
    transform: translateY(0);
}

.btn-icon {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
}

.input-group button:hover .btn-icon {
    transform: translateX(4px);
}

/* Error message box */
.search-error {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 600;
    background-color: rgba(239, 68, 68, 0.08);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239, 68, 68, 0.15);
    animation: slideUp var(--transition-normal) forwards;
}

.search-error svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Section Title */
.section-title {
    margin-top: 12px;
    margin-bottom: 4px;
    padding: 0 4px;
}

.section-title h3 {
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Profile Card styling */
.profile-card {
    border-left: 5px solid var(--primary);
    animation: fadeIn var(--transition-normal) forwards;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.profile-avatar {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-glow);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-info h2 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.badge {
    align-self: flex-start;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--bg-input);
    color: var(--text-muted);
}

.badge.pml {
    background-color: #fef3c7;
    color: #d97706;
}

.badge.pcl {
    background-color: #e0e7ff;
    color: #4f46e5;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.detail-label {
    color: var(--text-muted);
    font-weight: 500;
}

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

/* Team section */
.team-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.team-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    animation: fadeIn var(--transition-normal) forwards;
}

.team-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-member-name {
    font-size: 0.95rem;
    font-weight: 700;
}

.team-member-role {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.contact-btn {
    background: #25d366; /* WhatsApp Green */
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
    transition: all var(--transition-fast);
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

.contact-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Search Alokasi Box */
.search-alokasi-box {
    margin-bottom: 4px;
}

.search-alokasi-box input {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    color: var(--text-main);
    outline: none;
    transition: all var(--transition-fast);
}

.search-alokasi-box input:focus {
    border-color: var(--primary);
}

/* Allocation List styling */
.allocation-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.allocation-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeIn var(--transition-normal) forwards;
}

.allocation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

.subsls-code {
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    background-color: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
}

.region-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.region-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.region-item {
    display: flex;
    flex-direction: column;
}

.region-item-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
}

.region-item-val {
    font-size: 0.85rem;
    font-weight: 700;
}

.allocation-desc {
    background-color: var(--bg-input);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
    border-left: 3px solid var(--accent);
}

/* Skeleton Loading Animation */
.skeleton-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-line {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--border-color) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.header-skele {
    height: 24px;
    width: 60%;
}

.body-skele-1 {
    height: 16px;
    width: 90%;
}

.body-skele-2 {
    height: 16px;
    width: 40%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Modal Overlay styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    animation: fadeIn var(--transition-fast) forwards;
}

.modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: scaleUp var(--transition-fast) forwards;
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background-color: rgba(37, 211, 102, 0.1);
    color: #25d366;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.modal-icon svg {
    width: 24px;
    height: 24px;
}

.modal-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.45;
}

.modal-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.btn {
    flex: 1;
    padding: 10px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all var(--transition-fast);
}

.btn-secondary {
    background-color: var(--bg-input);
    color: var(--text-main);
}

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

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

.btn-primary:hover {
    opacity: 0.95;
}

.btn-wa {
    background: #25d366;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.btn-wa:hover {
    background: #20ba59;
}

/* Footer styling */
.app-footer {
    text-align: center;
    padding: 16px 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* Tabs Styling */
.tabs-container {
    margin-top: 16px;
    margin-bottom: 8px;
}

.tabs-nav {
    display: flex;
    background-color: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-md);
    gap: 4px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    background-color: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tab-pane {
    animation: fadeIn var(--transition-normal) forwards;
}

/* Helper Classes */
.hidden {
    display: none !important;
}

/* Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
