/* ============================================
   MOBILE PRO - ULTRA-OPTIMIERT
   Premium Mobile Experience
   ============================================ */

/* Smooth Scrolling für die gesamte Seite */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

body {
    overscroll-behavior-y: contain;
    touch-action: pan-y pinch-zoom;
}

/* Mobile Navigation */
@media screen and (max-width: 768px) {
    .main-nav {
        position: relative;
        margin-bottom: var(--spacing-lg);
    }

    .nav-wrapper {
        box-shadow: var(--shadow-md);
    }
}

/* Mobile Button Styles */
@media screen and (max-width: 768px) {
    button {
        transition: all 0.2s ease;
        min-height: 48px;
    }

    /* Button Press Animation */
    button:active {
        transform: scale(0.98);
        box-shadow: var(--shadow-sm);
    }
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.05); }
    }
}

/* Premium Input Styles */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="number"],
    select {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
    }

    /* Floating Label Effect */
    .form-group {
        position: relative;
    }

    .form-group label {
        transition: all 0.3s ease;
        pointer-events: none;
    }

    /* Input Focus Glow */
    input:focus,
    select:focus {
        transform: translateY(-2px);
        border-color: var(--primary-color);
        box-shadow: 
            0 0 0 3px rgba(0, 255, 65, 0.2),
            0 8px 24px rgba(0, 0, 0, 0.4),
            inset 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    /* Input mit Inhalt */
    input:not(:placeholder-shown) {
        border-color: rgba(0, 255, 65, 0.5);
    }
}

/* Premium Tool Cards */
@media screen and (max-width: 768px) {
    .tool-card {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }

    /* Card Glow Border Animation */
    .tool-card::before {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        background: linear-gradient(
            45deg,
            var(--primary-color),
            var(--secondary-color),
            var(--primary-color)
        );
        border-radius: 14px;
        opacity: 0;
        z-index: -1;
        transition: opacity 0.3s;
        animation: borderRotate 3s linear infinite;
    }

    @keyframes borderRotate {
        0% { filter: hue-rotate(0deg); }
        100% { filter: hue-rotate(360deg); }
    }

    .tool-card:focus-within::before {
        opacity: 0.6;
    }

    /* Card Hover/Focus Lift */
    .tool-card:focus-within {
        transform: translateY(-4px);
        box-shadow: 
            0 12px 40px rgba(0, 0, 0, 0.6),
            0 0 60px rgba(0, 255, 65, 0.3);
    }
}

/* Premium Result Box */
@media screen and (max-width: 768px) {
    .result-box {
        animation: resultSlideIn 0.4s ease;
        position: relative;
    }

    @keyframes resultSlideIn {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Better Code Display */
    .result-box pre {
        background: rgba(0, 0, 0, 0.5);
        border-left: 3px solid var(--primary-color);
        padding: 12px;
        border-radius: 6px;
        margin: 8px 0;
    }

    /* Syntax Highlighting Colors */
    .result-box .success {
        color: var(--primary-color);
        font-weight: 600;
    }

    .result-box .error {
        color: #ff6b6b;
        font-weight: 600;
    }

    .result-box .warning {
        color: #ffd93d;
        font-weight: 600;
    }

    .result-box .info {
        color: var(--secondary-color);
    }

    /* Copy Button mit Feedback */
    .copy-btn {
        position: relative;
        transition: all 0.3s ease;
    }

    .copy-btn::after {
        content: '📋';
        margin-left: 8px;
        transition: all 0.3s;
    }

    .copy-btn.copied {
        background: linear-gradient(135deg, 
            rgba(0, 255, 65, 0.4) 0%, 
            rgba(0, 212, 255, 0.3) 100%);
        border-color: var(--primary-color);
    }

    .copy-btn.copied::after {
        content: '✓';
        color: var(--primary-color);
        animation: checkBounce 0.4s ease;
    }

    @keyframes checkBounce {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.3); }
    }
}

/* Loading Skeleton Screen */
@media screen and (max-width: 768px) {
    .loading-skeleton {
        background: linear-gradient(
            90deg,
            rgba(0, 255, 65, 0.05) 0%,
            rgba(0, 255, 65, 0.1) 50%,
            rgba(0, 255, 65, 0.05) 100%
        );
        background-size: 200% 100%;
        animation: shimmer 1.5s infinite;
        border-radius: 8px;
    }

    @keyframes shimmer {
        0% { background-position: -200% 0; }
        100% { background-position: 200% 0; }
    }

    /* Loading State für Tool Cards */
    .tool-card.loading {
        pointer-events: none;
        opacity: 0.6;
    }

    .tool-card.loading::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(
            90deg,
            transparent 0%,
            rgba(0, 255, 65, 0.1) 50%,
            transparent 100%
        );
        animation: loadingSweep 1.5s infinite;
    }

    @keyframes loadingSweep {
        0% { transform: translateX(-100%); }
        100% { transform: translateX(100%); }
    }
}

/* Status Messages mit Icons */
@media screen and (max-width: 768px) {
    .status-message {
        padding: 14px 16px;
        border-radius: 10px;
        margin: 14px 0;
        display: flex;
        align-items: center;
        gap: 12px;
        font-weight: 600;
        border: 2px solid;
        animation: messageSlideIn 0.4s ease;
    }

    @keyframes messageSlideIn {
        from {
            opacity: 0;
            transform: translateX(-30px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .status-message::before {
        font-size: 1.5em;
        animation: iconPop 0.5s ease;
    }

    @keyframes iconPop {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.2); }
    }

    .status-message.success {
        background: rgba(0, 255, 65, 0.15);
        border-color: var(--primary-color);
        color: var(--primary-color);
    }

    .status-message.success::before {
        content: '✓';
    }

    .status-message.error {
        background: rgba(255, 59, 48, 0.15);
        border-color: #ff3b30;
        color: #ff6b6b;
    }

    .status-message.error::before {
        content: '✗';
    }

    .status-message.warning {
        background: rgba(255, 217, 61, 0.15);
        border-color: #ffd93d;
        color: #ffd93d;
    }

    .status-message.warning::before {
        content: '⚠';
    }

    .status-message.info {
        background: rgba(0, 212, 255, 0.15);
        border-color: var(--secondary-color);
        color: var(--secondary-color);
    }

    .status-message.info::before {
        content: 'ℹ';
    }
}

/* Better Badges */
@media screen and (max-width: 768px) {
    .badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        border-radius: 8px;
        font-size: 0.75em;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        border: 2px solid;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        transition: all 0.3s ease;
    }

    .badge:active {
        transform: scale(0.95);
    }

    .badge.success {
        background: rgba(0, 255, 65, 0.2);
        border-color: var(--primary-color);
        color: var(--primary-color);
    }

    .badge.error {
        background: rgba(255, 59, 48, 0.2);
        border-color: #ff3b30;
        color: #ff6b6b;
    }

    .badge.warning {
        background: rgba(255, 217, 61, 0.2);
        border-color: #ffd93d;
        color: #ffd93d;
    }
}

/* Scroll to Top Button */
@media screen and (max-width: 768px) {
    .scroll-to-top {
        position: fixed;
        bottom: 24px;
        right: 24px;
        width: 56px;
        height: 56px;
        background: linear-gradient(135deg, 
            rgba(0, 255, 65, 0.3) 0%, 
            rgba(0, 212, 255, 0.2) 100%);
        border: 2px solid var(--primary-color);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5em;
        color: var(--primary-color);
        cursor: pointer;
        opacity: 0;
        transform: translateY(100px);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        box-shadow: 
            0 8px 24px rgba(0, 0, 0, 0.5),
            0 0 40px rgba(0, 255, 65, 0.3);
    }

    .scroll-to-top.visible {
        opacity: 1;
        transform: translateY(0);
    }

    .scroll-to-top:active {
        transform: scale(0.9);
    }

    .scroll-to-top::before {
        content: '↑';
        animation: scrollArrow 1.5s infinite;
    }

    @keyframes scrollArrow {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-5px); }
    }
}

/* Premium Header */
@media screen and (max-width: 768px) {
    header {
        position: relative;
        overflow: hidden;
    }

    /* Header Background Animation */
    header::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 200%;
        height: 100%;
        background: linear-gradient(
            90deg,
            transparent,
            rgba(0, 255, 65, 0.1),
            transparent
        );
        animation: headerShine 3s infinite;
    }

    @keyframes headerShine {
        0% { left: -100%; }
        100% { left: 100%; }
    }

    header h1 {
        animation: textGlow 2s infinite alternate;
    }

    @keyframes textGlow {
        0% {
            text-shadow: 
                0 0 20px rgba(0, 255, 65, 0.8),
                0 0 40px rgba(0, 255, 65, 0.4),
                0 2px 4px rgba(0, 0, 0, 0.5);
        }
        100% {
            text-shadow: 
                0 0 30px rgba(0, 255, 65, 1),
                0 0 60px rgba(0, 255, 65, 0.6),
                0 2px 4px rgba(0, 0, 0, 0.5);
        }
    }
}

/* Premium Footer */
@media screen and (max-width: 768px) {
    footer {
        position: relative;
        overflow: hidden;
    }

    footer::before {
        content: '';
        position: absolute;
        top: -1px;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(
            90deg,
            transparent,
            var(--primary-color),
            transparent
        );
        animation: footerLine 2s infinite;
    }

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

/* Haptic Feedback Simulation (Visual) */
@media screen and (max-width: 768px) {
    .haptic-feedback {
        animation: hapticVibrate 0.1s;
    }

    @keyframes hapticVibrate {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-2px); }
        75% { transform: translateX(2px); }
    }
}

/* Pull to Refresh Indicator */
@media screen and (max-width: 768px) {
    .pull-indicator {
        position: fixed;
        top: -60px;
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, 
            rgba(0, 255, 65, 0.3) 0%, 
            rgba(0, 212, 255, 0.2) 100%);
        border: 2px solid var(--primary-color);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: top 0.3s ease;
        z-index: 1001;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    .pull-indicator.active {
        top: 20px;
    }

    .pull-indicator::before {
        content: '↓';
        color: var(--primary-color);
        font-size: 1.5em;
        animation: pullArrow 1s infinite;
    }

    @keyframes pullArrow {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(5px); }
    }
}

/* Better Tooltips */
@media screen and (max-width: 768px) {
    [data-tooltip] {
        position: relative;
    }

    [data-tooltip]::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%) scale(0);
        padding: 8px 12px;
        background: rgba(0, 0, 0, 0.95);
        color: var(--primary-color);
        font-size: 0.75em;
        white-space: nowrap;
        border-radius: 6px;
        border: 1px solid var(--primary-color);
        opacity: 0;
        transition: all 0.3s ease;
        pointer-events: none;
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }

    [data-tooltip]:active::after {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* Enhanced Scrollbars */
@media screen and (max-width: 768px) {
    *::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    *::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.3);
        border-radius: 4px;
    }

    *::-webkit-scrollbar-thumb {
        background: linear-gradient(
            180deg,
            var(--primary-color),
            var(--secondary-color)
        );
        border-radius: 4px;
        box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    }

    *::-webkit-scrollbar-thumb:active {
        background: linear-gradient(
            180deg,
            var(--secondary-color),
            var(--primary-color)
        );
    }
}

/* Context Menu Prevention (Better UX) */
@media screen and (max-width: 768px) {
    img,
    .nav-tab,
    .tool-card {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    /* Aber Text in Result-Boxes sollte kopierbar sein */
    .result-box,
    input,
    select {
        -webkit-user-select: text;
        user-select: text;
    }
}





