/* Reset and Base */
.ino-reddit-monitor {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f8f9fa;
    min-height: 100vh;
    padding: 20px;
}

.ino-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header */
.ino-header {
    background: white;
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.ino-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.ino-header p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Navigation */
.ino-nav-tabs {
    display: flex;
    padding: 0 30px;
}

.ino-nav-tab {
    padding: 16px 24px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
}

.ino-nav-tab:first-child {
    margin-left: 0;
}

.ino-nav-tab:hover {
    color: #333;
    background: rgba(0,0,0,0.02);
}

.ino-nav-tab.active {
    color: #0073aa;
    background: white;
    border-bottom: 3px solid #0073aa;
}

/* Content */
.ino-content {
    padding: 30px;
}

.ino-tab-content {
    display: none;
}

.ino-tab-content.active {
    display: block;
}

/* Cards */
.ino-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ino-card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.ino-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.ino-card-body {
    padding: 25px;
}

/* Forms */
.ino-form-group {
    margin-bottom: 20px;
}

.ino-form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.ino-form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.ino-form-control:focus {
    outline: none;
    border-color: #0073aa;
    background: white;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.ino-form-control::placeholder {
    color: #999;
}

.ino-form-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    display: block;
}

.ino-form-check {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.ino-form-check-input {
    margin: 0 8px 0 0;
    width: auto;
}

.ino-form-check-label {
    margin: 0;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Input Groups */
.ino-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.ino-input-group .ino-form-control {
    flex: 1;
}

/* Form Grid */
.ino-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 200px;
    gap: 20px;
    margin-bottom: 25px;
}

/* Tags */
.ino-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    min-height: 32px;
    padding: 8px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #fafafa;
}

.ino-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: #0073aa;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    gap: 6px;
}

.ino-tag-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: background 0.2s ease;
}

.ino-tag-remove:hover {
    background: rgba(255,255,255,0.2);
}

/* Buttons */
.ino-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    gap: 6px;
    min-width: 100px;
}

.ino-btn-primary {
    background: #0073aa;
    color: white;
}

.ino-btn-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.ino-btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

.ino-btn-secondary:hover {
    background: #e9ecef;
    color: #333;
}

.ino-btn-outline {
    background: transparent;
    color: #0073aa;
    border: 1px solid #0073aa;
}

.ino-btn-outline:hover {
    background: #0073aa;
    color: white;
}

.ino-btn-danger {
    background: #dc3545;
    color: white;
}

.ino-btn-danger:hover {
    background: #c82333;
}

.ino-btn-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ino-btn-close:hover {
    color: #666;
    background: #f0f0f0;
}

/* Group Form */
.ino-group-form {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin-top: 20px;
    background: #fafafa;
}

.ino-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.ino-form-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Actions Section */
.ino-actions-section {
    margin-top: 30px;
}

.ino-actions-section h4 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.ino-action-group {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 15px;
    background: white;
}

.ino-action-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.ino-action-settings {
    padding: 20px;
}

.ino-action-settings .ino-form-grid {
    grid-template-columns: 1fr;
    gap: 15px;
}

/* Form Actions */
.ino-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Settings Grid */
.ino-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.ino-settings-group {
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #fafafa;
}

.ino-settings-group h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ino-auth-status {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.ino-auth-status .ino-form-text {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.ino-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc3545;
    flex-shrink: 0;
}

.ino-status-indicator.authenticated {
    background: #28a745;
}

.ino-status-text {
    font-size: 13px;
    color: #666;
}

/* Modal */
.ino-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ino-modal.active {
    opacity: 1;
    visibility: visible;
}

.ino-modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 650px; /* Erweitert für alle Felder */
    width: 90%;
    max-height: 85vh; /* Etwas höher */
    overflow-y: auto;
}

.ino-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.ino-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ino-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ino-modal-close:hover {
    color: #666;
    background: #f0f0f0;
}

.ino-modal-body {
    padding: 25px;
}

.ino-modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fafafa;
}

/* Alerts */
.ino-alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ino-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ino-alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ino-alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.ino-alert .close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.ino-alert .close:hover {
    opacity: 1;
}

/* Loading */
.ino-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Empty State */
.ino-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.ino-empty-icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 20px;
}

.ino-empty-state h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.ino-empty-state p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Group Cards */
.ino-group-card {
    margin-bottom: 20px;
}

.ino-group-actions {
    display: flex;
    gap: 8px;
}

.ino-group-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ino-group-detail {
    margin-bottom: 15px;
}

.ino-group-detail strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #333;
    font-weight: 600;
}

.ino-group-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ino-group-tags .ino-tag {
    font-size: 11px;
    padding: 2px 6px;
}

.ino-group-actions-list {
    font-size: 13px;
    color: #666;
}

.ino-group-actions-list i {
    margin-right: 4px;
}

/* Spinner */
.fa-spin {
    animation: fa-spin 2s infinite linear;
}

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

.fa-spinner:before { content: "\f110"; }

/* Responsive */
@media (max-width: 768px) {
    .ino-reddit-monitor {
        padding: 10px;
    }
    
    .ino-container {
        border-radius: 8px;
    }
    
    .ino-header {
        padding: 20px;
    }
    
    .ino-header h1 {
        font-size: 24px;
    }
    
    .ino-content {
        padding: 20px;
    }
    
    .ino-card-header,
    .ino-card-body {
        padding: 20px;
    }
    
    .ino-form-grid {
        grid-template-columns: 1fr;
    }
    
    .ino-settings-grid {
        grid-template-columns: 1fr;
    }
    
    .ino-nav-tabs {
        overflow-x: auto;
        padding: 0 20px;
    }
    
    .ino-nav-tab {
        white-space: nowrap;
        margin-left: 15px;
    }
    
    .ino-form-actions {
        flex-direction: column;
    }
    
    .ino-modal-content {
        width: 95%;
        margin: 10px;
        max-height: 90vh;
    }
    
    .ino-group-details {
        grid-template-columns: 1fr;
    }
    
    .ino-group-actions {
        flex-direction: column;
    }
}

/* Post Management Styles */
.ino-maintenance-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.ino-maintenance-controls .ino-btn {
    justify-content: flex-start;
    text-align: left;
    padding: 12px 16px;
    min-width: auto;
    white-space: nowrap;
}

/* Statistics Styles */
.ino-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.ino-stat-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.ino-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ino-stat-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 5px;
}

.ino-stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Button Styles for Management */
.ino-btn i {
    flex-shrink: 0;
}

#ino-clear-title-duplicates {
    border-color: #17a2b8;
    color: #17a2b8;
}

#ino-clear-title-duplicates:hover {
    background: #17a2b8;
    color: white;
}

#ino-clear-author-duplicates {
    border-color: #28a745;
    color: #28a745;
}

#ino-clear-author-duplicates:hover {
    background: #28a745;
    color: white;
}

#ino-clear-combined-duplicates {
    border-color: #ffc107;
    color: #856404;
}

#ino-clear-combined-duplicates:hover {
    background: #ffc107;
    color: #212529;
}

#ino-clear-all-processed {
    border-color: #dc3545;
    color: #dc3545;
}

#ino-clear-all-processed:hover {
    background: #dc3545;
    color: white;
}

#ino-show-duplicate-stats {
    border-color: #6f42c1;
    color: #6f42c1;
}

#ino-show-duplicate-stats:hover {
    background: #6f42c1;
    color: white;
}

/* Animation for stats reveal */
#ino-duplicate-stats {
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Loading states for maintenance buttons */
.ino-maintenance-controls .ino-btn.ino-loading {
    opacity: 0.7;
    pointer-events: none;
}

.ino-maintenance-controls .ino-btn.ino-loading i {
    animation: fa-spin 1s infinite linear;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ino-maintenance-controls {
        grid-template-columns: 1fr;
    }
    
    .ino-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px;
    }
    
    .ino-stat-item {
        padding: 12px;
    }
    
    .ino-stat-number {
        font-size: 20px;
    }
    
    .ino-stat-label {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .ino-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .ino-maintenance-controls .ino-btn {
        justify-content: center;
        text-align: center;
    }
}

/* Enhanced card spacing for post management */
.ino-card:has(.ino-maintenance-controls) .ino-card-body {
    padding: 25px;
}

.ino-card:has(.ino-maintenance-controls) .ino-form-text {
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
}

/* Icon colors for different button types */
#ino-clear-title-duplicates .fa-heading {
    color: #17a2b8;
}

#ino-clear-author-duplicates .fa-user {
    color: #28a745;
}

#ino-clear-combined-duplicates .fa-broom {
    color: #ffc107;
}

#ino-clear-all-processed .fa-trash {
    color: #dc3545;
}

#ino-show-duplicate-stats .fa-chart-bar {
    color: #6f42c1;
}

/* Hover effects maintain icon colors */
.ino-btn:hover i {
    color: inherit !important;
}

/* Log Styles */
.ino-log-controls {
    display: flex;
    gap: 10px;
}

.ino-logs-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.ino-logs-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ino-log-entry {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    background: #fafafa;
}

.ino-log-entry.ino-log-info {
    border-left: 4px solid #17a2b8;
}

.ino-log-entry.ino-log-success {
    border-left: 4px solid #28a745;
}

.ino-log-entry.ino-log-error {
    border-left: 4px solid #dc3545;
}

.ino-log-entry.ino-log-match {
    border-left: 4px solid #ffc107;
    background: #fffbf0;
}

.ino-log-entry.ino-log-action {
    border-left: 4px solid #6f42c1;
}

.ino-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ino-log-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.ino-log-time {
    font-size: 12px;
    color: #666;
}

.ino-log-message {
    margin-bottom: 8px;
    font-size: 14px;
}

.ino-log-group {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.ino-log-data {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ino-log-data span {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #495057;
}

.ino-log-keyword {
    background: #fff3cd !important;
    color: #856404 !important;
}

.ino-log-post-title {
    background: #d1ecf1 !important;
    color: #0c5460 !important;
}

.ino-log-subreddit {
    background: #d4edda !important;
    color: #155724 !important;
}

.ino-log-actions {
    background: #e2e3e5 !important;
    color: #383d41 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .ino-log-controls {
        flex-direction: column;
    }
    
    .ino-log-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .ino-log-data {
        flex-direction: column;
        gap: 5px;
    }
}

/* Font Awesome Icons */
.fas, .far, .fab {
    font-family: "Font Awesome 5 Free", "Font Awesome 5 Brands";
    font-weight: 900;
}

.far { font-weight: 400; }
.fab { font-weight: 400; }

.fa-layer-group:before { content: "\f5fd"; }
.fa-cog:before { content: "\f013"; }
.fa-plus:before { content: "\f067"; }
.fa-times:before { content: "\f00d"; }
.fa-save:before { content: "\f0c7"; }
.fa-reddit:before { content: "\f1a1"; }
.fa-envelope:before { content: "\f0e0"; }
.fa-bell:before { content: "\f0f3"; }
.fa-comment:before { content: "\f075"; }
.fa-shield-alt:before { content: "\f3ed"; }
.fa-key:before { content: "\f084"; }
.fa-edit:before { content: "\f044"; }
.fa-trash:before { content: "\f1f8"; }
.fa-user:before { content: "\f007"; }
.fa-mobile-alt:before { content: "\f3cd"; }