* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;
    
    --bg-primary: #000000;
    --bg-secondary: #0f0f0f;
    --bg-tertiary: #1a1a1a;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    
    --border-color: #333333;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* ============ Sidebar ============ */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.logo {
    padding: 25px 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.logo h1 {
    font-size: 24px;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.logo p {
    color: var(--text-tertiary);
    font-size: 12px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    flex: 1;
}

.menu-btn {
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.menu-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
    transform: translateX(4px);
}

.menu-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.menu-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============ Main Content ============ */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.header h2 {
    font-size: 28px;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* ============ Tabs Content ============ */
.tabs-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ Cards ============ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    animation: slideUp 0.3s ease;
    backdrop-filter: blur(10px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.card h4 {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 15px;
}

/* ============ Forms ============ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.textarea {
    min-height: 100px;
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-tertiary);
    font-size: 12px;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-group .form-control {
    flex: 1;
}

/* ============ Buttons ============ */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(51, 65, 85, 0.8) 100%);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.9) 0%, rgba(30, 41, 59, 0.8) 100%);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--info) 0%, #0284c7 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.btn-info:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.button-group .btn {
    flex: 1;
    min-width: 120px;
}

/* ============ Color Picker ============ */
.color-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-input-group .form-control {
    flex: 1;
    font-family: 'Courier New', monospace;
}

.color-picker {
    width: 50px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
}

.color-presets {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.color-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-btn:hover {
    border-color: var(--primary);
    transform: scale(1.1);
}

/* ============ Image Preview ============ */
.image-preview {
    margin-top: 15px;
    padding: 15px;
    background: var(--surface);
    border-radius: 5px;
    text-align: center;
}

.image-preview.hidden {
    display: none;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 5px;
}

/* ============ Info Box ============ */
.info-box {
    background: rgba(0, 176, 244, 0.1);
    border-left: 4px solid var(--info);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.info-box strong {
    color: var(--info);
}

.info-box p {
    margin: 8px 0;
    font-size: 14px;
}

.info-box code {
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: var(--warning);
}

/* ============ JSON & Logs Display ============ */
.json-display,
.logs-display {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 15px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-height: 400px;
    color: #00FF00;
}

.logs-display {
    max-height: 500px;
    line-height: 1.5;
}

/* ============ Notifications ============ */
.notification {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    animation: slideDown 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification.hidden {
    display: none;
}

.notification.success {
    background: rgba(67, 181, 129, 0.2);
    border: 1px solid var(--success);
    color: #00FF00;
}

.notification.error {
    background: rgba(240, 71, 71, 0.2);
    border: 1px solid var(--danger);
    color: #FF6B6B;
}

.notification.info {
    background: rgba(0, 176, 244, 0.2);
    border: 1px solid var(--info);
    color: var(--info);
}

/* ============ Save Notification ============ */
.save-notification {
    position: fixed;
    bottom: 24px;
    right: -400px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.save-notification.show {
    right: 24px;
}

.save-notification.saved {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-color: var(--success);
}

.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-content strong {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.notification-content small {
    color: var(--text-tertiary);
    font-size: 12px;
}

.notification-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.notification-actions .btn {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
}

.btn-undo {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-undo:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(99, 102, 241, 0.2) 100%);
}

.btn-save-notification {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
}

.btn-save-notification:hover {
    transform: translateY(-2px);
}

.btn-save-notification.saved {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
}

.notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    min-width: 24px;
    animation: pulse 2s ease-in-out infinite;
}

.notification-icon.saved {
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* ============ Scrollbars ============ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .menu {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .menu-btn {
        flex: 1;
    }

    .content {
        flex: 1;
    }

    .tabs-content {
        padding: 15px;
    }

    .card {
        padding: 15px;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .btn {
        width: 100%;
    }
}
