/* ==========================================================================
   pixxu.net - Components CSS
   Wiederverwendbare Komponenten für alle Seiten
   ========================================================================== */

/* ==========================================================================
   TOAST/STATUS SYSTEM
   ========================================================================== */

/* Status Indicator - Bottom Right Position */
.status-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050; /* Higher than navbar (1030) and modals (1040) */
    max-width: 400px;
    width: auto;
}

/* Custom Toast Styles - Enhanced Version */
.custom-toast {
    position: relative;
    margin-bottom: 0.5rem;
    min-width: 300px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: none;
    animation: slideInFromRight 0.3s ease-out;
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
}

.custom-toast:last-child {
    margin-bottom: 0;
}

.custom-toast.hiding {
    animation: slideOutToRight 0.3s ease-in forwards;
}

.custom-toast .toast-content {
    display: inline-block;
    width: calc(100% - 30px);
    padding-right: 0.5rem;
}

.custom-toast .custom-close {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    filter: brightness(0) invert(1);
    opacity: 0.8;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.custom-toast .custom-close:hover {
    opacity: 1;
}

.custom-toast .custom-close::before {
    content: '×';
    font-size: 20px;
    line-height: 1;
}

/* Enhanced Toast Icons */
.custom-toast.alert-success .toast-content::before {
    content: '✓';
    display: inline-block;
    margin-right: 0.5rem;
    font-weight: bold;
    font-size: 1.1em;
}

.custom-toast.alert-danger .toast-content::before {
    content: '✕';
    display: inline-block;
    margin-right: 0.5rem;
    font-weight: bold;
    font-size: 1.1em;
}

.custom-toast.alert-warning .toast-content::before {
    content: '⚠';
    display: inline-block;
    margin-right: 0.5rem;
    font-weight: bold;
    font-size: 1.1em;
}

.custom-toast.alert-info .toast-content::before {
    content: 'ℹ';
    display: inline-block;
    margin-right: 0.5rem;
    font-weight: bold;
    font-size: 1.1em;
}

/* Auto-dismiss progress bar */
.custom-toast.auto-dismiss::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    animation: progressBar 5s linear;
}

/* Toast Colors - Enhanced */
.custom-toast.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.95) 100%);
    color: white;
    border-left: 4px solid #065f46;
    backdrop-filter: blur(10px);
}

.custom-toast.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
    color: white;
    border-left: 4px solid #7f1d1d;
    backdrop-filter: blur(10px);
}

.custom-toast.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95) 0%, rgba(217, 119, 6, 0.95) 100%);
    color: white;
    border-left: 4px solid #78350f;
    backdrop-filter: blur(10px);
}

.custom-toast.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%);
    color: white;
    border-left: 4px solid #1e3a8a;
    backdrop-filter: blur(10px);
}

/* Toast Animations */
@keyframes progressBar {
    from { width: 100%; }
    to { width: 0%; }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ==========================================================================
   LOADING OVERLAYS
   ========================================================================== */

.loading-overlay {
    border-radius: inherit;
}

.loading-content {
    text-align: center;
    color: var(--primary-color, #6366f1);
}

.loading-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==========================================================================
   MODAL STYLES
   ========================================================================== */

.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
}

/* Progress Modal */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: var(--border-color);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ==========================================================================
   ACCORDION STYLES
   ========================================================================== */

.accordion-item {
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    border-radius: 8px !important;
    overflow: hidden;
}

.accordion-header {
    margin: 0;
}

.accordion-button {
    background: var(--light-bg);
    border: none;
    color: var(--text-primary);
    font-weight: 500;
    padding: 1rem 1.25rem;
    border-radius: 8px !important;
    box-shadow: none;
    transition: all 0.3s ease;
}

.accordion-button:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(2px);
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: none;
}

.accordion-button:not(.collapsed):hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateX(0);
}

.accordion-button:not(.collapsed)::after {
    filter: brightness(0) invert(1);
}

.accordion-button:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.accordion-button::after {
    transition: transform 0.3s ease;
}

.accordion-body {
    padding: 1.5rem 1.25rem;
    background: white;
}

/* Accordion Icons */
.accordion-button i {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
}

/* Accordion Collapse Animation */
.accordion-collapse {
    transition: height 0.3s ease;
}

/* Accordion Content Specific Styles */
.accordion-body h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.accordion-body .mb-4:last-child {
    margin-bottom: 0 !important;
}

.accordion-body .btn-group {
    margin-bottom: 0.75rem;
}

.accordion-body .btn-group:last-child {
    margin-bottom: 0;
}

.accordion-body .form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.accordion-body .form-control,
.accordion-body .form-select {
    margin-bottom: 0.75rem;
}

.accordion-body .range-slider {
    margin: 0.75rem 0;
}

.accordion-body .input-group {
    margin-bottom: 0.75rem;
}

/* Custom Accordion Variants */
.accordion-item.primary .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.accordion-item.success .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.accordion-item.warning .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
}

.accordion-item.info .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
}

/* ==========================================================================
   UPLOAD AREAS
   ========================================================================== */

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--light-bg);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.upload-area.dragover {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.upload-content h6 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   CARD COMPONENTS
   ========================================================================== */

/* Basic Card */
.card-component {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(99, 102, 241, 0.1);
    position: relative;
    overflow: hidden;
}

.card-component::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card-component:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
}

.card-component:hover::before {
    transform: scaleX(1);
}

/* Info Grid Component */
.info-grid {
    display: grid;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.info-label {
    font-weight: 500;
    color: var(--text-secondary);
}

/* Setting Groups */
.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.color-input-group {
    display: flex;
    gap: 0.5rem;
}

.form-control-color {
    max-width: 60px;
    padding: 0.25rem;
}

/* ==========================================================================
   BADGE COMPONENTS
   ========================================================================== */

.badge {
    font-weight: 500;
    border-radius: 50px;
    padding: 0.5rem 1rem;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%) !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, var(--text-secondary) 0%, #475569 100%) !important;
}

/* ==========================================================================
   ALERT COMPONENTS
   ========================================================================== */

.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    color: #1e40af;
    border-left: 4px solid var(--info-color);
}

/* ==========================================================================
   SPINNER COMPONENTS
   ========================================================================== */

.spinner-border {
    border-color: var(--primary-color);
    border-right-color: transparent;
}

/* ==========================================================================
   CODE CONTAINER
   ========================================================================== */

.code-container {
    position: relative;
    background: #1e293b;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.code-container pre {
    margin: 0;
    color: #e2e8f0;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.installation-steps {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
}

.installation-steps ol {
    margin-bottom: 0;
}

.installation-steps li {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   ANIMATION CLASSES
   ========================================================================== */

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in-up.active {
    opacity: 1;
    transform: translateY(0);
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .custom-toast {
        min-width: auto;
        font-size: 0.9rem;
    }
    
    .status-indicator {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .accordion-button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .accordion-body {
        padding: 1rem;
    }
    
    .card-component {
        padding: 1.5rem;
        border-radius: 12px;
    }
}

@media (max-width: 576px) {
    .custom-toast {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .accordion-button {
        padding: 0.625rem 0.875rem;
        font-size: 0.85rem;
    }
    
    .accordion-body {
        padding: 0.875rem;
    }
    
    .card-component {
        padding: 1.25rem;
    }
    
    .upload-area {
        padding: 1.5rem;
    }
}