/* 🎯 Kompakte Icon-Only Buttons mit integrierten Icons */
/* FontAwesome 6.4.0 CDN Integration */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* CSS Custom Properties für konsistente Buttons */
:root {
    /* Button Größen */
    --btn-size-xs: 28px;
    --btn-size-sm: 32px;
    --btn-size: 36px;
    
    /* Spacing */
    --btn-gap: 6px;
    --btn-gap-mobile: 8px;
    
    /* Border Radius für abgerundete quadratische Buttons */
    --btn-border-radius: 8px;
    
    /* Schatten */
    --btn-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --btn-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --btn-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-Index für Tooltips */
    --btn-tooltip-z: 1000;
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    gap: var(--btn-gap);
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    padding: 4px;
}

/* Base Button Styling - Perfekt Quadratisch */
.action-buttons .btn {
    /* Layout */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--btn-size);
    height: var(--btn-size);
    padding: 0;
    margin: 0;
    
    /* Styling */
    border: none;
    border-radius: var(--btn-border-radius);
    background: #6b7280;
    color: white;
    
    /* Typography */
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    
    /* Interaction */
    cursor: pointer;
    transition: var(--btn-transition);
    box-shadow: var(--btn-shadow);
    
    /* Prevent text selection */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    
    /* Force square aspect ratio */
    aspect-ratio: 1;
    flex-shrink: 0;
}

/* Button Size Variants - Alle quadratisch */
.action-buttons .btn-xs {
    width: var(--btn-size-xs);
    height: var(--btn-size-xs);
    font-size: 12px;
}

.action-buttons .btn-sm {
    width: var(--btn-size-sm);
    height: var(--btn-size-sm);
    font-size: 13px;
}

/* Verstecke alle Textinhalte - nur Icons */
.action-buttons .btn-text,
.action-buttons .btn .btn-text,
.action-buttons .btn span:not(i):not([class*="fa-"]) {
    display: none !important;
}

/* Icon Styling */
.action-buttons .btn i {
    font-size: inherit;
    line-height: 1;
    margin: 0;
    padding: 0;
    display: block;
    width: auto;
    height: auto;
    text-align: center;
}

/* Sicherstelle, dass FontAwesome Icons korrekt angezeigt werden */
.action-buttons .btn i[class*="fa-"]::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands";
    font-weight: 900;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Color Variants mit modernen Gradients */
.action-buttons .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.action-buttons .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.action-buttons .btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.3);
}

.action-buttons .btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

.action-buttons .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.action-buttons .btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.action-buttons .btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.action-buttons .btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.action-buttons .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.action-buttons .btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.action-buttons .btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3);
}

.action-buttons .btn-info:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.action-buttons .btn-orange {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.3);
}

.action-buttons .btn-orange:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

/* Active/Pressed State */
.action-buttons .btn:active {
    transform: translateY(0) !important;
    box-shadow: var(--btn-shadow) !important;
    transition: none !important;
}

/* Focus States für Accessibility */
.action-buttons .btn:focus {
    outline: none;
    box-shadow: 
        0 0 0 2px rgba(59, 130, 246, 0.2),
        var(--btn-shadow-hover);
}

.action-buttons .btn:focus:not(:active) {
    transform: translateY(-1px);
}

/* Disabled State */
.action-buttons .btn:disabled,
.action-buttons .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
    box-shadow: var(--btn-shadow) !important;
}

/* Loading State */
.action-buttons .btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.action-buttons .btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: btn-spinner 1s linear infinite;
}

@keyframes btn-spinner {
    to { transform: rotate(360deg); }
}

/* Enhanced Tooltips für Icon-Only Buttons */
.action-buttons .btn[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: var(--btn-tooltip-z);
    pointer-events: none;
    opacity: 0;
    animation: tooltip-fade-in 0.2s ease-out forwards;
}

.action-buttons .btn[title]:hover::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: var(--btn-tooltip-z);
    pointer-events: none;
    opacity: 0;
    animation: tooltip-fade-in 0.2s ease-out forwards;
}

@keyframes tooltip-fade-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --btn-size-xs: 32px;
        --btn-size-sm: 36px;
        --btn-size: 40px;
        --btn-gap: var(--btn-gap-mobile);
        --btn-border-radius: 10px;
    }
    
    .action-buttons {
        gap: var(--btn-gap-mobile);
        padding: 6px;
    }
    
    .action-buttons .btn {
        font-size: 15px;
    }
    
    .action-buttons .btn-xs {
        font-size: 13px;
    }
    
    .action-buttons .btn-sm {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    :root {
        --btn-size-xs: 36px;
        --btn-size-sm: 40px;
        --btn-size: 44px;
        --btn-gap: 10px;
        --btn-border-radius: 12px;
    }
    
    .action-buttons {
        gap: 10px;
        padding: 8px;
    }
    
    .action-buttons .btn {
        font-size: 16px;
    }
    
    .action-buttons .btn-xs {
        font-size: 14px;
    }
    
    .action-buttons .btn-sm {
        font-size: 15px;
    }
    
    /* Touch-friendly tooltips */
    .action-buttons .btn[title]:active::before,
    .action-buttons .btn[title]:active::after {
        opacity: 1;
    }
}

/* Tablet-specific optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    :root {
        --btn-size-xs: 30px;
        --btn-size-sm: 34px;
        --btn-size: 38px;
        --btn-gap: 7px;
    }
    
    .action-buttons .btn {
        font-size: 14px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .action-buttons .btn {
        border: 2px solid currentColor;
        background: var(--bg-color, white) !important;
        color: var(--text-color, black) !important;
    }
    
    .action-buttons .btn:hover {
        background: var(--hover-bg-color, #f0f0f0) !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .action-buttons .btn,
    .action-buttons .btn::before,
    .action-buttons .btn::after {
        transition: none !important;
        animation: none !important;
    }
    
    .action-buttons .btn:hover {
        transform: none !important;
    }
}

/* Print Styles */
@media print {
    .action-buttons {
        display: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .action-buttons .btn[title]:hover::before {
        background: rgba(255, 255, 255, 0.9);
        color: black;
    }
    
    .action-buttons .btn[title]:hover::after {
        border-top-color: rgba(255, 255, 255, 0.9);
    }
}