/* ========================================= */
/* MODAL PRINCIPAL */
/* ========================================= */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
  overflow: auto;
  padding: 20px;
  box-sizing: border-box;
}

.modal-content-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.image-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
}

.modal-content {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  background-color: transparent;
  opacity: 0;
  transition: opacity 0.5s ease;
  border-radius: 4px;
  display: none;
}

.modal-content.loaded {
  opacity: 1;
  display: block;
}

.close {
  position: absolute;
  top: 25px;
  left: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  z-index: 2002;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close:hover {
  color: #bbb;
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.7);
}

/* ========================================= */
/* SPINNER CÁMARA */
/* ========================================= */
.camera-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2001;
}

.camera-body {
    position: relative;
    width: 120px;
    height: 80px;
    background: #333;
    border-radius: 8px;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
    overflow: hidden;
}

.camera-lens {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #666, #999);
    border-radius: 50%;
    border: 3px solid #222;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lens-inner {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #888, #aaa);
    border-radius: 50%;
    border: 2px solid #444;
    animation: lensGlow 2s ease-in-out infinite alternate;
}

@keyframes lensGlow {
    0% { box-shadow: 0 0 10px rgba(255,255,255,0.3); }
    100% { box-shadow: 0 0 20px rgba(255,255,255,0.8); }
}

.camera-progress-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(to top, #4CAF50, #8BC34A, #CDDC39);
    transition: width 0.3s ease;
}

.camera-text {
    color: white;
    font-family: var(--font-secondary);
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
}

/* ========================================= */
/* BOTÓN COMPOSICIÓN */
/* ========================================= */
.composition-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2004;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.composition-toggle:hover {
    background: rgba(0, 0, 0, 1);
    transform: scale(1.1);
}

/* ========================================= */
/* COLUMNA DE ACCIONES - FIJA IZQUIERDA */
/* ========================================= */
.composition-actions-column {
    position: fixed;
    left: 20%;
    top: 42px;
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 2003;
    background: #F8F8F800;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: auto;
}

.composition-actions-column.show {
    display: block ruby;
    animation: fadeInUp 0.3s ease;
}

/* ========================================= */
/* PANEL DE REGLAS - FIJO INFERIOR */
/* ========================================= */
.composition-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    /*! height: 150px; */
    background: var(--color-background);
    border-top: 2px solid var(--color-border);
    display: none;
    z-index: 2003;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.2);
}

.composition-panel.show {
    display: flex;
    animation: fadeInUp 0.3s ease;
}

/* Contenedor reglas con scroll horizontal */
.composition-rules-container {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 15px;
    display: flex;
    align-items: center;
    background: var(--color-background);
}

.composition-rules-compact {
    display: flex;
    gap: 8px;
    width: max-content;
    padding: 0 10px;
}

/* ========================================= */
/* BOTONES DE ACCIÓN - CORREGIDOS PARA AMBOS TEMAS */
/* ========================================= */
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 9px 12px;
    background: #F8F8F8;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text);
    font-size: 0.85rem;
    width: auto;
}

.action-btn:hover {
    background: var(--color-highlight);
    transform: translateY(-1px);
    border-color: var(--color-text);
}

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

.action-btn i {
    font-size: 0.9rem;
    color: var(--color-text);
}

/* ========================================= */
/* BOTONES DE REGLAS - CORREGIDOS PARA AMBOS TEMAS */
/* ========================================= */
.rule-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text);
    text-align: center;
    min-width: 60px;
    flex-shrink: 0;
}

.rule-compact:hover {
    background: var(--color-highlight);
    transform: translateY(-1px);
    border-color: var(--color-text);
}

.rule-compact.active {
    background: var(--color-text);
    color: var(--color-background);
    border-color: var(--color-text);
}

.rule-icon-small {
    font-size: 1.1rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.rule-compact span {
    font-size: 0.65rem;
    font-weight: 500;
    line-height: 1.2;
    color: inherit;
}

/* Overlay composición */
.composition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    opacity: 0.4;
    object-fit: fill;
    display: none;
}

/* Indicador regla activa */
.rule-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #ffe036;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: var(--font-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 2005;
    display: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 180px;
}

/* Controles like */
.like-controls {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.85);
    padding: 12px 25px;
    border-radius: 30px;
    z-index: 2003;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.like-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.like-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.like-button:hover::before {
    transform: scale(1);
}

.like-button:hover {
    transform: scale(1.1);
}

.like-button.liked {
    color: var(--color-like);
    animation: buttonPulse 0.6s ease;
}

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

.like-count {
    color: white;
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ========================================= */
/* FEEDBACK DE LIKES MEJORADO */
/* ========================================= */
.like-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background: linear-gradient(135deg, var(--color-like), #ff6b6b);
    color: white;
    padding: 25px 40px;
    border-radius: 20px;
    z-index: 2010;
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: var(--font-secondary);
    font-size: 1.3rem;
    font-weight: 600;
    box-shadow: 0 15px 35px rgba(231, 76, 60, 0.4);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    pointer-events: none;
    animation: likeFeedback 2.5s ease-in-out forwards;
}

.like-feedback.unliked {
    background: linear-gradient(135deg, #666, #888);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.like-feedback i {
    font-size: 1.8rem;
    animation: heartBeat 0.6s ease-in-out 0.3s 3;
}

@keyframes likeFeedback {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) rotate(-10deg);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
    }
    30% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    85% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) rotate(5deg);
    }
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Efecto de partículas para like */
.like-particles {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2009;
    pointer-events: none;
}

.like-particle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--color-like);
    border-radius: 50%;
    animation: particleFloat 1.5s ease-out forwards;
}

.like-particle:nth-child(2n) {
    background: #ff9ff3;
}

.like-particle:nth-child(3n) {
    background: #feca57;
}

.like-particle:nth-child(4n) {
    background: #48dbfb;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* Confeti para like especial */
.confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2008;
    pointer-events: none;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 20px;
    background: var(--color-like);
    top: -20px;
    animation: confettiFall 3s linear forwards;
}

.confetti-piece:nth-child(2n) {
    background: #ff9ff3;
}

.confetti-piece:nth-child(3n) {
    background: #feca57;
}

.confetti-piece:nth-child(4n) {
    background: #48dbfb;
}

.confetti-piece:nth-child(5n) {
    background: #1dd1a1;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================= */
/* RESPONSIVE */
/* ========================================= */
@media (max-width: 768px) {
    position: fixed;
    left: 20%;
    top: 42px;
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 2003;
    background: #F8F8F800;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: auto;
    }
    
    .composition-panel {
        height: 75px;
    }
    
    .composition-rules-container {
        padding: 10px;
    }
    
    .rule-compact {
        min-width: 55px;
        padding: 6px 4px;
    }
    
    .rule-compact span {
        font-size: 0.6rem;
    }
    
    .composition-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        top: 15px;
        right: 15px;
    }
    
    .close {
        top: 15px;
        left: 15px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
    
    .action-btn {
        /*! padding: 6px 3px; */
        font-size: 0.6rem;
        width: 51px;
        display: flex;
        /*! float: left; */
        /*! height: 18px; */
    }
    
    .action-btn i {
        font-size: 0.8rem;
    }
    
    .like-controls {
        padding: 10px 20px;
        gap: 12px;
    }
    
    .like-button {
        font-size: 1.6rem;
        width: 40px;
        height: 40px;
    }
    
    .like-count {
        font-size: 0.9rem;
    }
    
    .like-feedback {
        padding: 20px 30px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .composition-actions-column {
        position: fixed;
    left: 20%;
    top: 42px;
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 2003;
    background: #F8F8F800;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: auto;
    }
    
    .composition-panel {
        height: 75px;
    }
    
    .composition-rules-compact {
        gap: 6px;
    }
    
    .rule-compact {
        min-width: 50px;
        padding: 5px 3px;
    }
    
    .rule-icon-small {
        font-size: 1rem;
    }
    
    .like-feedback {
        padding: 15px 25px;
        font-size: 1rem;
    }
    
    .like-feedback i {
        font-size: 1.5rem;
    }
}