/* ============================================
   💎 GEM-SYSTEM STYLES - DARK GLASSMORPHISM
   ============================================ */

/* Gem-Anzeige im Header */
.gem-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    box-shadow: 0 4px 15px 0 rgba(31, 38, 135, 0.2);
    transition: all 0.3s ease;
}

.gem-display:hover {
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 6px 20px 0 rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.gem-icon {
    font-size: 24px;
    animation: gem-pulse 2s ease-in-out infinite;
}

@keyframes gem-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.gem-counter {
    font-size: 20px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    min-width: 30px;
    text-align: center;
}

.gem-counter.gems-low {
    color: rgba(255, 100, 100, 0.95);
    text-shadow: 0 2px 8px rgba(220, 53, 69, 0.5);
    animation: gem-warning 1s ease-in-out infinite;
}

@keyframes gem-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Daily Bonus Button */
.daily-bonus-btn {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.4);
    animation: pulse-gift 2s ease-in-out infinite;
}

.daily-bonus-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(245, 87, 108, 0.6);
}

@keyframes pulse-gift {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(245, 87, 108, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 4px 16px rgba(245, 87, 108, 0.7);
    }
}

.gem-earn-btn {
    background: rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.gem-earn-btn:hover {
    background: rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Gem-Animationen */
.gem-spent-animation {
    animation: gem-spent 0.5s ease-out;
}

@keyframes gem-spent {
    0% { transform: scale(1); }
    50% { transform: scale(0.8); color: rgba(255, 100, 100, 0.95); }
    100% { transform: scale(1); }
}

.gem-earned-animation {
    animation: gem-earned 0.8s ease-out;
}

@keyframes gem-earned {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: rgba(76, 175, 80, 0.95); }
    100% { transform: scale(1); }
}

/* Gem Modal Content */
.gem-modal-content {
    max-width: 500px;
    text-align: center;
}

.gem-modal-content h2 {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gem-modal-content p {
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
}

/* Gem Info */
.gem-info {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin: 20px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.gem-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gem-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gem-value {
    font-size: 24px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
}

.gem-value-highlight {
    color: rgba(76, 175, 80, 0.95);
    text-shadow: 0 2px 8px rgba(76, 175, 80, 0.5);
    animation: gem-pulse 1.5s ease-in-out infinite;
}

/* Earn Options */
.gem-earn-options {
    margin: 20px 0;
}

.gem-earn-option {
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.gem-earn-option:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.gem-earn-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.gem-earn-option h3 {
    margin: 10px 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 18px;
}

.gem-earn-option p {
    margin: 5px 0 15px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.gem-reward {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(76, 175, 80, 0.3);
    border: 1px solid rgba(76, 175, 80, 0.5);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 15px;
}

/* Earn Preview (größer) */
.gem-earn-preview {
    margin: 30px 0;
    padding: 30px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

.gem-earn-icon-large {
    font-size: 72px;
    margin-bottom: 15px;
}

.gem-earn-preview h3 {
    margin: 15px 0;
    color: rgba(255, 255, 255, 0.9);
}

.gem-reward-large {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(76, 175, 80, 0.4);
    border: 2px solid rgba(76, 175, 80, 0.6);
    border-radius: 25px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    font-size: 24px;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

/* Ad Modal */
.ad-modal-content {
    max-width: 800px;
    text-align: center;
}

.ad-container {
    margin: 20px auto;
    height: 360px;
    width: 100%;
    max-width: 640px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* Echte Video-Ads (Production) füllen Container komplett */
.ad-container ins,
.ad-container iframe {
    width: 100% !important;
    height: 100% !important;
}

/* Ad Countdown */
.ad-countdown {
    margin: 20px 0;
}

.ad-countdown p {
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.85);
}

.ad-countdown strong {
    color: rgba(102, 126, 234, 0.95);
    font-size: 20px;
    text-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
}

.countdown-progress {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.countdown-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    width: 0%;
    transition: width 1s linear;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    animation: toast-slide-in 0.3s ease-out;
    min-width: 250px;
}

.toast-success {
    border-left: 4px solid rgba(76, 175, 80, 0.8);
    background: rgba(76, 175, 80, 0.2);
}

.toast-warning {
    border-left: 4px solid rgba(255, 193, 7, 0.8);
    background: rgba(255, 193, 7, 0.2);
}

.toast-info {
    border-left: 4px solid rgba(102, 126, 234, 0.8);
    background: rgba(102, 126, 234, 0.2);
}

@keyframes toast-slide-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-fade-out {
    animation: toast-fade-out 0.3s ease-out forwards;
}

@keyframes toast-fade-out {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .gem-display {
        padding: 8px 15px;
    }

    .gem-icon {
        font-size: 20px;
    }

    .gem-counter {
        font-size: 18px;
    }

    .gem-earn-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .gem-info {
        flex-direction: column;
        gap: 15px;
    }

    #toast-container {
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: unset;
    }
}

/* ============================================
   📊 AD PLACEHOLDERS (Development Mode)
   ============================================ */

.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    min-height: 90px;
    text-align: center;
}

.ad-placeholder-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.ad-placeholder p {
    margin: 5px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
}

.ad-placeholder small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.ad-placeholder-large {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.ad-placeholder-sidebar {
    width: 300px; /* Platz für 300x600 (größte Variante) */
    min-height: 600px;
    position: sticky;
    top: 20px;
}

/* Sidebar Container */
.sidebar-ad-container {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    width: 300px; /* Passt für beide: 300x600 und 160x600 */
    display: flex;
    justify-content: center; /* Zentriert 160x600 wenn geladen */
}

.sidebar-ad-container.left {
    left: 20px;
}

.sidebar-ad-container.right {
    right: 20px;
}

/* Responsive: Sidebars nur ab 1200px Breite */
@media (max-width: 1200px) {
    .sidebar-ad-container {
        display: none;
    }
}

/* ============================================
   🤖 SAM INTEGRATION STYLES
   ============================================ */

/* SAM Status Bar */
.sam-status-bar {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.sam-status-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sam-status-icon {
    font-size: 24px;
}

.sam-status-bar #samExtractorStatusText,
.sam-status-bar #samRemoverStatusText {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* SAM Progress Bar */
.sam-progress-container {
    margin-top: 12px;
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sam-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* Indeterminate Progress Animation */
@keyframes indeterminate {
    0% {
        transform: translateX(-100%);
        width: 30%;
    }
    50% {
        transform: translateX(50%);
        width: 50%;
    }
    100% {
        transform: translateX(200%);
        width: 30%;
    }
}

/* SAM Layouts - 2-Spalten wie GrabCut */
.sam-extractor-layout {
    display: flex;
    gap: 20px;
    flex-direction: row; /* 2 Spalten nebeneinander */
}

.sam-canvas-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sam-remover-layout {
    display: flex;
    gap: 20px;
    flex-direction: row;
}

/* SAM Controls */
.sam-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* SAM nutzt jetzt die gleichen CSS-Klassen wie GrabCut!
   Keine speziellen Styles mehr nötig. */

/* ============================================
   🔒 BILD-SCHUTZ (Anti-Rechtsklick)
   ============================================ */

/* Verhindere Rechtsklick-Speichern und Drag-Drop auf Bilder */
.modal-content img,
#extractorSheetImage,
canvas {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: auto; /* Erlaubt Klicks, aber verhindert Drag */
}

/* Overlay-Schutz für Modal-Bilder */
.modal-content img {
    position: relative;
}

.modal-content img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
}
