/* 
 * Demo Swup.js Sederhana
 * Tanpa Fragment Plugin - Lebih stabil dengan PageSpeed
 */

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

/* Navigation */
nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

nav a {
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

nav a:hover {
    background: #f1f5f9;
    color: #0f172a;
}

nav a.is-active {
    background: #2563eb;
    color: #ffffff;
}

/* Main Content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card h2 {
    color: #0f172a;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.card p {
    color: #64748b;
    margin-bottom: 0;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #64748b;
    font-size: 1.1rem;
}

/* Component Grid */
.component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.component-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.component-card:hover {
    border-color: #2563eb;
    box-shadow: 0 8px 16px -4px rgba(37, 99, 235, 0.15);
}

.component-icon {
    width: 56px;
    height: 56px;
    background: #eff6ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: #2563eb;
}

.component-card h3 {
    font-size: 1.1rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.component-card p {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.component-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.version {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Footer */
footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 0;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* Swup Transitions */
.transition-fade {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

html.is-animating .transition-fade {
    opacity: 0;
    transform: translateY(10px);
}

html.is-rendering .transition-fade {
    opacity: 1;
    transform: translateY(0);
}

/* Loading State */
body.is-changing {
    cursor: wait;
}

/* Responsive */
@media (max-width: 640px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    nav {
        justify-content: center;
    }
    
    .component-grid {
        grid-template-columns: 1fr;
    }
}
