/* Modern Dark Theme für Product Monitor */
:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252d3d;
    --bg-hover: #2d3548;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --border-color: #30363d;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

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

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Navigation */
.navigation {
    width: 201px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.navigation .logo {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.navigation .logo h2 {
    font-size: 1.3rem;
    color: var(--accent-primary);
}

.navigation nav ul {
    list-style: none;
}

.navigation nav ul li {
    margin-bottom: 8px;
}

.navigation nav ul li a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.navigation nav ul li a:hover,
.navigation nav ul li a.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Content Wrapper */
.content-wrapper {
    margin-left: 200px;
    flex: 1;
    padding: 0;
    max-width: calc(100vw - 200px);
    overflow-x: hidden;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
}

/* Content */
.content {
    padding: 30px 30px 0px 30px;
    max-width: 100%;
    overflow-x: hidden;
}

/* Filter & Search Bar */
.filter-bar {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: var(--card-shadow);
    max-width: 100%;
}

.filter-bar input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.filter-bar input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Add Product Button */
.add-product-btn {
    padding: 12px 24px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.add-product-btn:hover {
    background: var(--accent-hover);
}

/* Product Table */
.product-table-wrapper {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: var(--card-shadow);
    max-width: 100%;
    position: relative;
    scroll-behavior: smooth;
}

/* Native Scrollbar verstecken */
.product-table-wrapper::-webkit-scrollbar {
    display: none;
}

.product-table-wrapper {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Custom Scrollbar Wrapper (fixed unten) */
.custom-scrollbar-wrapper {
    position: fixed;
    bottom: 0;
    left: 250px;
    right: 0;
    background: rgba(26, 31, 46, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 30px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
    z-index: 95;
    transition: transform 0.3s ease;
}

/* Custom Scrollbar Container */
.custom-scrollbar-container {
    max-width: 100%;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    margin: 0 auto;
}

/* Custom Scrollbar Track */
.custom-scrollbar-track {
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

/* Custom Scrollbar Thumb */
.custom-scrollbar-thumb {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
    border-radius: 12px;
    position: absolute;
    top: 0;
    left: 0;
    cursor: grab;
    transition: background 0.2s, box-shadow 0.2s;
    min-width: 80px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.custom-scrollbar-thumb:hover {
    background: linear-gradient(90deg, var(--accent-hover), var(--accent-primary));
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
}

.custom-scrollbar-thumb:active {
    cursor: grabbing;
    background: var(--accent-hover);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.6);
}

.scrollable-table {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
    max-width: 100%;
    margin-bottom: 32px;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

.product-table thead {
    background: var(--bg-tertiary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.product-table th {
    padding: 5px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    background: var(--bg-tertiary);
}

.product-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.product-table th.sortable:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.product-table th.sortable .sort-icon {
    font-size: 12px;
    margin-left: 4px;
    opacity: 0.5;
}

.product-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.product-table tbody tr:hover {
    background: var(--bg-hover);
}

.product-table td {
    padding: 8px 5px;
    color: var(--text-primary);
}

.product-table td.center {
    text-align: center;
}

.product-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
}

.product-name {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.product-name:hover {
    color: var(--accent-primary);
}

/* Product Grid for Dashboard */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 12px;
    border-radius: 8px;
}

.product-card h3 {
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-public {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.badge-private {
    background: rgba(251, 191, 36, 0.1);
    color: var(--warning);
}

.badge-own {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
}

/* Status Indicators */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-active {
    background: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: pulse 2s infinite;
}

.status-inactive {
    background: var(--text-muted);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Action Buttons */
.action-btn {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    margin: 0 4px;
    white-space: nowrap;
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.action-btn.success {
    border-color: var(--success);
    color: var(--success);
}

.action-btn.success:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--success);
    color: var(--success);
}

/* Product Details Page */
.product-detail-header {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 24px;
}

.product-detail-header img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-tertiary);
    padding: 8px;
}

.product-detail-info h2 {
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.product-meta {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    flex-wrap: wrap;
}

.product-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    margin-top: 16px;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Activity Log */
.activity-log {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.activity-log h3 {
    padding: 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-size: 1.1rem;
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
}

.activity-table thead {
    background: var(--bg-tertiary);
}

.activity-table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.activity-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.activity-table tbody tr:last-child {
    border-bottom: none;
}

.activity-table td {
    padding: 12px 20px;
    color: var(--text-primary);
}

.price-cell {
    font-weight: 600;
    color: var(--success);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

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

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

/* Webhook Management */
.webhook-list {
    margin-top: 16px;
}

.webhook-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.webhook-item:hover {
    background: var(--bg-hover);
}

.webhook-info {
    flex: 1;
}

.webhook-name {
    font-weight: 500;
    color: var(--text-primary);
}

.webhook-url {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    word-break: break-all;
}

.webhook-toggle {
    margin-right: 12px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-hover);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--accent-primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    margin-right: 12px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-menu-close {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.mobile-menu-close:hover {
    background: var(--bg-hover);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-left {
    display: flex;
    align-items: center;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .product-table {
        min-width: 900px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 992px) {
    .navigation {
        width: 200px;
    }
    
    .content-wrapper {
        margin-left: 200px;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-bar input[type="text"] {
        width: 100%;
    }
    
    .product-table {
        min-width: 800px;
    }
}

@media (max-width: 768px) {
    .navigation {
        width: 280px;
        height: 100vh;
        position: fixed;
        left: -280px;
        top: 0;
        z-index: 1000;
        transition: left 0.3s ease;
        padding: 20px;
        border-right: 1px solid var(--border-color);
        border-bottom: none;
    }
    
    .navigation.mobile-open {
        left: 0;
    }
    
    .nav-header {
        margin-bottom: 20px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-menu-close {
        display: flex;
    }
    
    .navigation .logo h2 {
        font-size: 1.2rem;
    }
    
    .navigation nav ul {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .navigation nav ul li {
        margin-bottom: 0;
        width: 100%;
    }
    
    .navigation nav ul li a {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
    }
    
    .content-wrapper {
        margin-left: 0;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .header {
        padding: 15px;
        max-width: 100%;
    }
    
    .header-left {
        flex: 1;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .user-info {
        gap: 8px;
    }
    
    .content {
        padding: 15px;
        padding-bottom: 80px; /* Platz für fixed Scrollbar */
    }
    
    .filter-bar {
        padding: 15px;
    }
    
    .filter-buttons {
        width: 100%;
    }
    
    .filter-btn {
        flex: 1;
        min-width: 100px;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .add-product-btn {
        width: 100%;
    }
    
    /* Custom Scrollbar auf Mobile */
    .custom-scrollbar-wrapper {
        left: 0;
        right: 0;
        padding: 8px 15px;
    }
    
    .product-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        border-radius: 12px;
    }
    
    .product-table {
        min-width: 800px;
        font-size: 13px;
    }
    
    .product-table th,
    .product-table td {
        padding: 6px 4px;
    }
    
    .product-img {
        width: 40px;
        height: 40px;
    }
    
    .action-btn {
        padding: 6px 10px;
        font-size: 12px;
        margin: 2px;
    }
    
    .product-detail-header {
        flex-direction: column;
        text-align: center;
    }
    
    .product-detail-header img {
        width: 100px;
        height: 100px;
    }
    
    .product-meta {
        justify-content: center;
    }
    
    .modal-content {
        padding: 20px;
        margin: 0 10px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .product-card img {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .navigation {
        width: 260px;
        left: -260px;
    }
    
    .filter-btn {
        width: 100%;
    }
    
    .user-info {
        justify-content: flex-end;
    }
    
    .user-info span {
        display: none;
    }
    
    .product-table {
        font-size: 12px;
    }
    
    .product-table th,
    .product-table td {
        padding: 10px 6px;
    }
    
    .badge {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .navigation,
    .header,
    .filter-bar,
    .action-btn,
    .add-product-btn {
        display: none;
    }
    
    .content-wrapper {
        margin-left: 0;
    }
    
    .product-table-wrapper {
        box-shadow: none;
    }
}
