/* Reset dan Variabel */
:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --background-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

/* Transisi untuk login/logout */
.login-screen, .app-content {
    transition: opacity 0.5s ease-in-out;
}

.fade-out {
    opacity: 0;
}

.login-screen.fade-in,
.app-content.fade-in {
    opacity: 1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styling */
header {
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-text {
    text-align: center;
    flex: 1;
}

header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-btn {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
    font-size: 1.2rem;
}

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

/* Logout Button */
.logout-btn {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.logout-btn:hover {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
    transform: scale(1.05);
}

/* Main Layout */
main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Config Panel */
.config-panel {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.config-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.config-section:last-child {
    border-bottom: none;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

/* Form Elements */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.2);
}

input[type="range"] {
    width: 90%;
    margin-right: 10px;
}

#jumlah-notif-value {
    font-weight: bold;
    color: var(--primary-color);
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

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

.primary-btn:hover {
    background-color: #3a5bd9;
    transform: translateY(-2px);
}

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

.secondary-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Preview Panel */
.preview-panel {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.preview-container {
    position: relative;
    height: 400px;
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: #f0f0f0;
    background-image: linear-gradient(45deg, #e0e0e0 25%, transparent 25%, transparent 75%, #e0e0e0 75%, #e0e0e0),
                      linear-gradient(45deg, #e0e0e0 25%, transparent 25%, transparent 75%, #e0e0e0 75%, #e0e0e0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

/* Notification Styling */
.sales-bubble {
    position: absolute;
    width: 280px;
    padding: 15px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
}

.sales-bubble.kiri-bawah {
    left: 20px;
    bottom: 20px;
}

.sales-bubble.kanan-bawah {
    right: 20px;
    bottom: 20px;
}

.sales-bubble-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(74, 108, 247, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.sales-bubble-content {
    flex: 1;
}

.sales-bubble-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.sales-bubble-text {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.sales-bubble-time {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 5px;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
    animation: slideUp 0.5s ease-in-out;
}

.bounce {
    animation: bounce 0.5s ease-in-out;
}

.slide-in {
    animation: slideIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes bounce {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 80%;
    max-width: 800px;
}

.close-modal {
    color: var(--secondary-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: var(--text-color);
}

.code-container {
    margin-top: 20px;
    position: relative;
}

pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    max-height: 300px;
    border: 1px solid var(--border-color);
}

code {
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

#copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Footer Styling */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.footer p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Dark Mode Support */
body.dark-mode {
    --background-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #e0e0e0;
    --border-color: #404040;
    --secondary-color: #aaa;
}

body.dark-mode .footer p {
    color: #aaa;
}

body.dark-mode .preview-container {
    background-color: #333;
    background-image: linear-gradient(45deg, #404040 25%, transparent 25%, transparent 75%, #404040 75%, #404040),
                      linear-gradient(45deg, #404040 25%, transparent 25%, transparent 75%, #404040 75%, #404040);
}

body.dark-mode pre {
    background-color: #333;
    color: #e0e0e0;
}

body.dark-mode .sales-bubble {
    background-color: var(--card-bg);
    color: var(--text-color);
}

/* Auto Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body:not(.light-mode) {
        --background-color: #1a1a1a;
        --card-bg: #2d2d2d;
        --text-color: #e0e0e0;
        --border-color: #404040;
        --secondary-color: #aaa;
    }
    
    body:not(.light-mode) .footer p {
        color: #aaa;
    }
    
    body:not(.light-mode) .preview-container {
        background-color: #333;
        background-image: linear-gradient(45deg, #404040 25%, transparent 25%, transparent 75%, #404040 75%, #404040),
                          linear-gradient(45deg, #404040 25%, transparent 25%, transparent 75%, #404040 75%, #404040);
    }
    
    body:not(.light-mode) pre {
        background-color: #333;
        color: #e0e0e0;
    }
    
    body:not(.light-mode) .sales-bubble {
        background-color: var(--card-bg);
        color: var(--text-color);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .preview-panel {
        margin-top: 30px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .footer {
        margin-top: 30px;
        padding: 15px 0;
    }
    
    .footer p {
        font-size: 12px;
        padding: 0 10px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .header-text {
        order: 1;
    }
    
    .header-actions {
        order: 2;
        justify-content: center;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .login-card {
        padding: 20px;
    }
    
    .login-card h2 {
        font-size: 1.8rem;
    }
}

/* Login Screen Styling */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--background-color);
    padding: 20px;
}

.login-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    transition: var(--transition);
}

.login-card h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2rem;
}

.login-subtitle {
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-size: 1rem;
}

.login-input-group {
    position: relative;
    margin-bottom: 20px;
}

.login-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    display: flex;
    align-items: center;
}

.login-icon {
    width: 20px;
    height: 20px;
    color: var(--secondary-color);
}

#password-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

#password-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.2);
}

#login-button {
    width: 100%;
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#login-button:hover {
    background-color: #3a5bd9;
    transform: translateY(-2px);
}

.login-button-icon {
    width: 18px;
    height: 18px;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    color: var(--secondary-color);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(74, 108, 247, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
    
/* Media Queries */
@media (max-width: 768px) {
    .tagline {
        font-size: 0.9rem;
    }
}