/* Modern Design System */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --background-color: #f8f9fa;
    --text-color: #2b2d42;
    --light-gray: #e9ecef;
    --white: #ffffff;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
    --cursor-size: 20px;
}

/* Custom Cursor Styles */
* {
    cursor: none !important;
}

.cursor-dot,
.cursor-dot-outline {
    pointer-events: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    z-index: 9999;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
}

.cursor-dot-outline {
    width: var(--cursor-size);
    height: var(--cursor-size);
    background-color: rgba(67, 97, 238, 0.3);
    animation: cursorAnim 0.8s infinite alternate;
}

@keyframes cursorAnim {
    from {
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* Better touch handling and scrolling */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    height: -webkit-fill-available;
}

/* Ensure proper height on mobile */
body {
    min-height: -webkit-fill-available;
    overscroll-behavior-y: none;
    position: relative;
}

/* Animated Background */
@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Gaya umum */
body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
    background: linear-gradient(-45deg, #ee7752, #4361ee, #23d5ab, #23a6d5);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
}

.container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    text-align: center;
    max-width: 700px;
    width: 90%;
    margin: 2rem auto;
    border: 1px solid rgba(255, 255, 255, 0.18);
    
    /* Animasi container saat dimuat */
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}

/* Animasi saat container aktif */
.tab-content.active .container {
    transform: translateY(0);
    opacity: 1;
}

h1 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* --- Gaya Area Logo --- */
.logo-area {
    text-align: center;
    padding: 2rem 0;
    background-color: var(--white);
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 2rem;
}

.main-logo {
    max-width: 180px; /* Ukuran maksimal logo */
    height: auto;
    display: block; /* Agar margin auto berfungsi */
    margin: 0 auto; /* Menengahkan logo secara horizontal */
}

/* --- Gaya Tab Menu dengan Animasi --- */
.tab-menu {
    display: flex;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.tab-button {
    background: none;
    border: 2px solid transparent;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-color);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    border-radius: 8px;
}

/* Input dan Button Styling */
input[type="file"] {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 1.5rem auto;
    padding: 1.2rem;
    border: 2px dashed var(--light-gray);
    border-radius: 12px;
    transition: var(--transition);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Better touch feedback */
input[type="file"]:hover,
input[type="file"]:focus {
    border-color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.05);
    outline: none;
}

/* Touch-friendly file input area */
input[type="file"]::file-selector-button {
    font-size: 1rem;
    padding: 0.8rem 1.2rem;
    margin-right: 1rem;
    border-radius: 8px;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

input[type="file"]::file-selector-button:hover {
    background: var(--secondary-color);
}

button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    margin: 1rem 0;
    min-width: 200px;
}

button:hover:not(:disabled) {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

button:disabled {
    background-color: var(--light-gray);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Status messages */
#status, #upscaleStatus {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
}

/* Preview Image Container */
#preview-image {
    margin-top: 2rem;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

#preview-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    transition: var(--transition);
}

/* Responsive Design */
/* Tablet Styles */
@media (max-width: 1024px) {
    .container {
        width: 85%;
        padding: 2rem;
        margin: 1.5rem auto;
    }

    h1 {
        font-size: 2rem;
    }

    .tab-menu {
        padding: 0.8rem;
    }

    .tab-button {
        padding: 0.9rem 1.8rem;
        font-size: 1rem;
    }

    input[type="file"] {
        max-width: 90%;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .container {
        width: 92%;
        padding: 1.5rem;
        margin: 1rem auto;
    }

    h1 {
        font-size: 1.6rem;
        margin-bottom: 0.8rem;
    }

    p {
        font-size: 1rem;
        margin-bottom: 1.2rem;
    }

    .tab-menu {
        padding: 0.5rem;
        flex-direction: row;
        width: 100%;
        gap: 0.5rem;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .tab-button {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        flex: 1;
        min-width: 120px;
        white-space: nowrap;
    }

    button {
        width: 100%;
        max-width: none;
        padding: 0.9rem 1.5rem;
    }

    input[type="file"] {
        max-width: 100%;
        padding: 0.8rem;
        margin: 1rem auto;
    }

    .main-logo {
        max-width: 140px;
        margin-bottom: 1.5rem;
    }

    #status, #upscaleStatus {
        font-size: 0.9rem;
        padding: 0.8rem;
        margin-top: 1rem;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 1.2rem;
        margin: 0.8rem auto;
    }

    h1 {
        font-size: 1.4rem;
    }

    p {
        font-size: 0.95rem;
    }

    .tab-menu {
        padding: 0.4rem;
    }

    .tab-button {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
        min-width: auto;
    }

    button {
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
    }
}

/* Handle Landscape Mode */
@media (max-height: 600px) and (orientation: landscape) {
    .container {
        margin: 0.5rem auto;
    }

    .main-logo {
        max-width: 100px;
        margin-bottom: 1rem;
    }

    h1 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }

    p {
        margin-bottom: 0.8rem;
    }

    .tab-menu {
        position: relative;
    }
}

/* Cursor Hover Effects */
button:hover ~ .cursor-dot,
input:hover ~ .cursor-dot,
a:hover ~ .cursor-dot {
    transform: translate(-50%, -50%) scale(2);
    background-color: var(--accent-color);
}

button:hover ~ .cursor-dot-outline,
input:hover ~ .cursor-dot-outline,
a:hover ~ .cursor-dot-outline {
    transform: translate(-50%, -50%) scale(2);
    background-color: rgba(67, 97, 238, 0.2);
}

/* Hide default cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    .cursor-dot,
    .cursor-dot-outline {
        display: none;
    }
    * {
        cursor: auto !important;
    }
}

/* Loading Animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Success Message */
.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Error Message */
.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Gaya untuk tab yang sedang aktif */
.tab-button.active {
    background-color: #333; /* Latar belakang gelap */
    color: #fff; /* Teks putih */
}

/* Animasi Fade-in Konten Tab */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Gaya elemen lainnya */
input[type="file"] {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
}

button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover:not(:disabled) {
    background-color: #0056b3;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#status, #upscaleStatus {
    margin-top: 20px;
    font-weight: bold;
    color: #555;
}

.success {
    color: #28a745;
}

.error {
    color: #dc3545;
}