:root {
    --primary-color: #9804ca;
    --primary-hover: #620282;
    --background-color: #f0f2f5;
    --surface-color: #ffffff;
    --text-color-primary: #1d042e;
    --text-color-secondary: #382e3f;
    --border-color: #896f9a;
    --header-height: 70px;
    --border-radius: 8px;
    --container-shadow: 0 8px 24px rgba(0,0,0,0.1);
    --container-padding: 30px;
    --mobile-padding: 20px;
    --success-color: #28a794;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: calc(var(--header-height) + 30px) var(--container-padding) 40px;
    box-sizing: border-box;
    width: 100%;
    gap: 30px;
}

aside {
    width: 100%;
    padding: var(--container-padding);
    text-align: center;
    box-sizing: border-box;
    background-color: var(--surface-color);
    border-top: 1px solid #e0e0e0;
}

aside a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

aside a:hover {
    text-decoration: underline;
}

.header {
    background: var(--surface-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: var(--header-height);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* CONTAINER STYLES - KONSISTEN */
.container {
    background: var(--surface-color);
    padding: var(--container-padding);
    border-radius: 12px;
    box-shadow: var(--container-shadow);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

/* Variasi container berdasarkan konten */
.container-form, .container-list {
    max-width: 550px;
    margin: 0 auto;
    clear: both;
}

.container-wide {
    max-width: 800px;
}

.container-full {
    max-width: 100%;
}

h1 {
    margin-top: 0;
    font-size: 28px;
    color: var(--text-color-primary);
    line-height: 1.3;
}

.subtitle {
    color: var(--text-color-secondary);
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.5;
}

#shorten-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#long-url {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

#long-url:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(152, 4, 202, 0.1);
}

#shorten-form button {
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-hover));
    color: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#shorten-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(152, 4, 202, 0.3);
}

#shorten-form button:disabled {
    background: #c1aac5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#result {
    margin-top: 30px;
    text-align: left;
}

.short-url-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #f8f9fa;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    margin-top: 10px;
    border: 1px solid #e9ecef;
}

#short-url {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--primary-hover);
    font-weight: bold;
    text-decoration: none;
    font-size: 14px;
}

#short-url:hover {
    text-decoration: underline;
}

#copy-btn, #share-link-btn {
    padding: 8px 15px;
    border: none;
    color: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}
#copy-btn { 
    background-color: var(--success-color); 
}
#copy-btn:hover { 
    background-color: #218838; 
}
#share-link-btn { 
    background-color: var(--primary-color); 
}
#share-link-btn:hover { 
    background-color: var(--primary-hover); 
}

/* QR Code Container Styles */
.qr-code-container {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#qr-code-image {
    max-width: 200px;
    width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.qr-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
}

.button-download, .button-share {
    display: inline-block;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: bold;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    font-size: 14px;
    flex: 1;
    min-width: 80px;
    text-align: center;
}
.button-download { 
    background-color: var(--info-color); 
}
.button-download:hover { 
    background-color: #138496; 
}
.button-share { 
    background-color: #6c757d; 
}
.button-share:hover { 
    background-color: #5a6268; 
}

/* QR Art Section Styles */
.qr-art-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.qr-art-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color), var(--success-color));
}

.qr-art-section h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.qr-art-section > p {
    margin: 0 0 1rem 0;
    color: var(--text-color-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.qr-art-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

#qr-art-prompt {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--surface-color);
}

#qr-art-prompt:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(152, 4, 202, 0.1);
}

#qr-art-prompt::placeholder {
    color: #896f9a;
}

#generate-qr-art-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#generate-qr-art-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(152, 4, 202, 0.3);
}

#generate-qr-art-btn:disabled {
    background: #c1aac5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.qr-art-image-container {
    text-align: center;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
}

#qr-art-image {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 2px solid var(--surface-color);
    transition: transform 0.3s ease;
}

#qr-art-image:hover {
    transform: scale(1.02);
}

.qr-art-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.qr-art-actions .button-download,
.qr-art-actions .button-share {
    min-width: 150px;
    font-size: 0.85rem;
    padding: 8px 16px;
}

.qr-art-prompt-display {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    text-align: left;
}

.qr-art-prompt-display span {
    color: var(--text-color-primary);
    font-weight: 500;
}

.qr-art-loading {
    text-align: center;
    padding: 1.5rem;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
}

.qr-art-loading p {
    margin: 0 0 1rem 0;
    color: var(--text-color-secondary);
    font-size: 0.9rem;
}

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

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

.qr-art-fallback {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffd351;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
    text-align: center;
}

.qr-art-fallback p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
}

/* Enhanced QR Art Features */
.qr-art-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
}

.feature-item {
    text-align: center;
    padding: 1rem;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.feature-text {
    font-size: 0.8rem;
    color: var(--text-color-secondary);
    line-height: 1.3;
}

/* Prompt Suggestions */
.prompt-suggestions {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
}

.prompt-suggestions h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color-primary);
    font-size: 0.9rem;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.suggestion-tag {
    padding: 0.4rem 0.8rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-color-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

#preview-image {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border: 1px solid #eee;
}

#page-description.description {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
    font-size: 14px;
    text-align: left;
}

.destination { 
    background-color: #f8f9fa; 
    padding: 12px 15px; 
    border-radius: var(--border-radius); 
    font-family: "Courier New", Courier, monospace;
    word-wrap: break-word;
    margin-top: 5px;
    color: #555;
    text-align: left;
    border: 1px solid #eee;
    font-size: 14px;
    line-height: 1.4;
}

.countdown {
    font-weight: bold;
    font-size: 18px;
    margin-top: 25px;
    color: var(--text-color-primary);
}

#transit-share-actions {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

#transit-share-actions .button-share {
    width: 100%;
    max-width: 300px;
}

/* Static Pages */
.container.static-page {
    text-align: left;
}
.static-page h2 {
    margin-top: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    color: var(--text-color-primary);
}
.static-page ul { 
    padding-left: 20px; 
}
.static-page li { 
    margin-bottom: 10px; 
    line-height: 1.5;
}

/* Recent URLs Section */
#recent-links-section h2 {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    color: var(--text-color-primary);
}
#recent-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}
#recent-links-list li {
    padding: 15px 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: background-color 0.2s ease;
}
#recent-links-list li:hover {
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
}
#recent-links-list li:last-child { 
    border-bottom: none; 
}
#recent-links-list a {
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 16px;
    word-break: break-all;
    line-height: 1.3;
}
#recent-links-list a:hover { 
    text-decoration: underline; 
}
#recent-links-list .link-title {
    font-size: 14px;
    color: var(--text-color-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Posts Styles */
.post-title {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    line-height: 1.3;
}

.post-title:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.post-date {
    display: block;
    font-size: 0.875rem;
    color: var(--text-color-secondary);
    margin-bottom: 0.75rem;
    font-style: italic;
}

.post-description {
    color: var(--text-color-secondary);
    line-height: 1.5;
    font-size: 0.95rem;
    margin: 0;
}

#posts-feed-section h2, #posts-section h2 {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    color: var(--text-color-primary);
}

#posts-feed-list, #posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

#posts-feed-list li, #posts-list li {
    padding: 20px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background-color 0.2s ease;
}

#posts-feed-list li:hover, #posts-list li:hover {
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
}

#posts-feed-list li:last-child, #posts-list li:last-child {
    border-bottom: none;
}

#load-more-btn {
    display: block;
    width: 100%;
    max-width: 200px;
    margin: 2rem auto;
    padding: 12px 24px;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(152, 4, 202, 0.3);
}

#load-more-btn:disabled {
    background: #c1aac5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.view-all-posts {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.view-all-posts a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.view-all-posts a:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

.loading-placeholder, .error-placeholder {
    color: var(--text-color-secondary);
    text-align: center;
    padding: 20px;
}

.text-error {
    color: var(--danger-color);
    font-weight: bold;
    margin-top: 15px;
    text-align: center;
    padding: 10px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: var(--border-radius);
}

.hidden { 
    display: none !important; 
}

.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}
.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: #333;
}

/* Success States */
.success-message {
    color: var(--success-color);
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: var(--border-radius);
    padding: 10px 15px;
    margin-top: 10px;
    text-align: center;
}

/* Info States */
.info-message {
    color: var(--info-color);
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: var(--border-radius);
    padding: 10px 15px;
    margin-top: 10px;
    text-align: center;
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 768px) {
    :root {
        --container-padding: var(--mobile-padding);
    }
    
    main {
        padding: calc(var(--header-height) + 20px) var(--mobile-padding) 30px;
        gap: 20px;
    }
    
    .navbar {
        padding: 0 var(--mobile-padding);
    }
    
    .nav-links {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        gap: 0;
        flex-direction: column;
        background-color: var(--surface-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 0;
    }
    
    .nav-links.active { 
        left: 0; 
    }
    
    .nav-links li {
        padding: 15px 0;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
    }
    
    .nav-links li:last-child { 
        border-bottom: none; 
    }
    
    .hamburger { 
        display: block; 
    }
    
    .hamburger.active .bar:nth-child(2) { 
        opacity: 0; 
    }
    
    .hamburger.active .bar:nth-child(1) { 
        transform: translateY(8px) rotate(45deg); 
    }
    
    .hamburger.active .bar:nth-child(3) { 
        transform: translateY(-8px) rotate(-45deg); 
    }
    
    .container {
        padding: var(--mobile-padding);
    }
    
    h1 {
        font-size: 24px;
    }
    
    .subtitle {
        font-size: 15px;
    }
    
    .short-url-container {
        flex-direction: column;
        gap: 10px;
    }
    
    #copy-btn, #share-link-btn {
        width: 100%;
    }
    
    .qr-actions {
        flex-direction: column;
    }
    
    .button-download, .button-share {
        min-width: auto;
        width: 100%;
    }
    
    /* QR Art Mobile Styles */
    .qr-art-form {
        flex-direction: column;
    }
    
    .qr-art-actions {
        flex-direction: column;
    }
    
    .qr-art-actions .button-download,
    .qr-art-actions .button-share {
        min-width: auto;
        width: 100%;
    }
    
    .qr-art-features {
        grid-template-columns: 1fr;
    }
    
    .suggestion-tags {
        justify-content: flex-start;
    }
    
    #qr-art-image {
        max-width: 250px;
    }
    
    #recent-links-list li,
    #posts-feed-list li,
    #posts-list li {
        padding: 15px 10px;
    }
    
    .post-title {
        font-size: 1rem;
    }
    
    .post-description {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    :root {
        --mobile-padding: 15px;
    }
    
    main {
        padding: calc(var(--header-height) + 15px) var(--mobile-padding) 20px;
    }
    
    .container {
        padding: var(--mobile-padding);
    }
    
    h1 {
        font-size: 22px;
    }
    
    .logo a {
        font-size: 20px;
    }
    
    .qr-art-section {
        padding: 1rem;
    }
    
    #qr-art-image {
        max-width: 200px;
    }
}

/* Print Styles */
@media print {
    .header,
    .qr-art-section,
    .qr-actions,
    .button-share {
        display: none !important;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    #qr-code-image,
    #qr-art-image {
        max-width: 150px;
    }
}