/* MCtoHytale - Custom Styles
   Design inspired by Cubrix.fr
   Primary color: #00bcd4 (Cyan/Turquoise)
   Dark theme: #1d373e
*/

/* Custom properties */
:root {
    --primary: #00bcd4;
    --primary-dark: #0097a7;
    --primary-light: #4dd0e1;
    --accent: #00e5ff;
    --bg-dark: #1d373e;
    --bg-darker: #152a30;
    --bg-card: #234249;
    --bg-light: #2d4a52;
    --text-primary: #ffffff;
    --text-secondary: #b0bec5;
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
}

/* Base styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-primary);
}

/* Card component */
.card {
    background-color: var(--bg-card);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--bg-light);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    border-color: rgba(0, 188, 212, 0.3);
}

/* Primary button */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -8px rgba(0, 188, 212, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Secondary button */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: transparent;
    color: var(--text-primary);
    font-weight: 600;
    border-radius: 0.75rem;
    border: 2px solid var(--bg-light);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: rgba(0, 188, 212, 0.1);
}

/* Input field */
.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-dark);
    border: 2px solid var(--bg-light);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field::placeholder {
    color: #64748b;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.2);
}

/* Glow effects */
.glow {
    box-shadow: 0 0 20px rgba(0, 188, 212, 0.3);
}

.glow-text {
    text-shadow: 0 0 20px rgba(0, 188, 212, 0.5);
}

/* Animations */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 188, 212, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 188, 212, 0.8);
    }
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

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

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Progress bar */
.progress-bar {
    height: 0.5rem;
    background-color: var(--bg-dark);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Toast notifications */
.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    color: white;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slide-in 0.3s ease;
}

.toast-success {
    background-color: var(--success);
}

.toast-error {
    background-color: var(--error);
}

.toast-warning {
    background-color: var(--warning);
}

.toast-info {
    background-color: var(--primary);
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Drag and drop zone */
.drop-zone {
    border: 2px dashed var(--bg-light);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    transition: all 0.2s ease;
}

.drop-zone.active {
    border-color: var(--primary);
    background-color: rgba(0, 188, 212, 0.05);
}

.drop-zone:hover {
    border-color: rgba(0, 188, 212, 0.5);
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.badge-error {
    background-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.badge-warning {
    background-color: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.badge-info {
    background-color: rgba(0, 188, 212, 0.2);
    color: var(--primary);
}

/* Grid pattern background */
.bg-grid {
    background-image:
        linear-gradient(rgba(0, 188, 212, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 188, 212, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Selection color */
::selection {
    background-color: var(--primary);
    color: white;
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Responsive utilities */
@media (max-width: 640px) {
    .card {
        padding: 1rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.625rem 1.25rem;
    }
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-weight: 500;
    color: var(--text-secondary);
}

td {
    padding: 1rem 0;
}

tbody tr {
    border-bottom: 1px solid var(--bg-light);
}

tbody tr:last-child {
    border-bottom: none;
}

/* Loader/Spinner */
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-light);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Credit counter animation */
.credit-counter {
    transition: all 0.3s ease;
}

.credit-counter.updated {
    transform: scale(1.1);
    color: var(--primary);
}

/* Hover card effect */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.4);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass effect */
.glass {
    background: rgba(35, 66, 73, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}


/* ============================================================
   Before/After Comparison Slider
   ============================================================ */

.comparison-slider {
    position: relative;
    overflow: hidden;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
}

/* Before: full background layer */
.comparison-slider .cs-before {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.comparison-slider .cs-before img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* After: full size, clipped via clip-path so image never distorts.
   Après=droite → on masque tout ce qui est < 50% depuis la gauche.
   Le JS met à jour cette valeur en temps réel. */
.comparison-slider .cs-after {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 0 0 50%);
    transition: clip-path 0s; /* no transition — updated in real time */
}

.comparison-slider .cs-after img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Divider line */
.comparison-slider .cs-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 10;
}

/* Circular drag handle */
.comparison-slider .cs-handle {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 188, 212, 0.4);
    pointer-events: none;
    z-index: 11;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.comparison-slider:hover .cs-handle,
.comparison-slider:active .cs-handle {
    box-shadow: 0 2px 20px rgba(0, 188, 212, 0.5);
    border-color: rgba(0, 188, 212, 0.9);
}

.comparison-slider .cs-handle svg {
    width: 20px;
    height: 20px;
    color: #1d373e;
}

/* BEFORE / AFTER labels */
.comparison-slider .cs-label {
    position: absolute;
    top: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 12;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.comparison-slider .cs-label-before {
    left: 10px;
    background: rgba(0, 0, 0, 0.55);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.comparison-slider .cs-label-after {
    right: 10px;
    background: rgba(0, 188, 212, 0.75);
    color: #fff;
    border: 1px solid rgba(0, 229, 255, 0.4);
}
