@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #09090b; /* Zinc 950 */
    --panel-bg: #18181b; /* Zinc 900 */
    --panel-border: #27272a; /* Zinc 800 */
    --primary-color: #e11d48; /* Rose 600 - Merah elegan */
    --primary-hover: #be123c; /* Rose 700 */
    --text-main: #fafafa; /* Zinc 50 */
    --text-muted: #a1a1aa; /* Zinc 400 */
    --danger-color: #ef4444; 
    --success-color: #10b981;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-top: 0;
    letter-spacing: -0.025em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

a:hover {
    color: var(--primary-hover);
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.container-narrow {
    max-width: 480px;
}

/* Panels */
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background-color: var(--primary-color);
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--panel-border);
    color: var(--text-main) !important;
}

.btn-outline:hover {
    background-color: var(--panel-border);
    color: #ffffff !important;
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    background-color: var(--bg-color);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.2);
}

/* Table / Email List */
.email-list-container {
    overflow-x: auto;
    width: 100%;
}

.email-list {
    width: 100%;
    border-collapse: collapse;
}

.email-list th {
    text-align: left;
    padding: 16px 32px;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0,0,0,0.2);
}

.email-list td {
    padding: 20px 32px;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.email-list tr:hover td {
    background-color: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.email-list tr:last-child td {
    border-bottom: none;
}

.email-list tr.unread td {
    color: #ffffff;
    font-weight: 500;
}

.email-list tr.unread td:first-child::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin-right: 12px;
    vertical-align: middle;
}

.email-subject {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Header Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    height: 72px;
    background-color: rgba(24, 24, 27, 0.8); /* Zinc 900 with transparency */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--panel-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
    color: #ffffff;
}

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.875rem;
    background-color: rgba(225, 29, 72, 0.1);
    color: #fda4af;
    border: 1px solid rgba(225, 29, 72, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.2);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px; /* Pill shape */
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--panel-border);
    color: var(--text-muted);
}

.badge-primary {
    background-color: rgba(225, 29, 72, 0.15);
    color: #fda4af;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.email-body {
    background-color: var(--bg-color); 
    padding: 32px; 
    border-radius: 8px; 
    overflow-x: auto; 
    color: var(--text-muted); 
    line-height: 1.7;
    border: 1px solid var(--panel-border);
}

.email-body a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(225, 29, 72, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
