/* ===================================
   SVG Animado Manager Styles
   =================================== */

/* Modal principal */
.svg-manager-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.svg-manager-content {
    background: var(--color-bg-primary, #1e1e2e);
    border: 1px solid var(--color-border, #333);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Header */
.svg-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border, #333);
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.svg-manager-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.svg-manager-header .close-modal {
    font-size: 28px;
    font-weight: 300;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    line-height: 1;
    padding: 0 8px;
}

.svg-manager-header .close-modal:hover {
    opacity: 0.8;
    transform: rotate(90deg);
}

/* Body */
.svg-manager-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.svg-section {
    display: flex;
    flex-direction: column;
}

.svg-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary, #e0e0e0);
    border-bottom: 2px solid var(--color-primary, #4A90E2);
    padding-bottom: 8px;
}

/* Lista de SVGs */
.svg-assets-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.svg-asset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--color-bg-secondary, #2a2a3a);
    border: 1px solid var(--color-border, #333);
    border-radius: 8px;
    transition: all 0.2s;
}

.svg-asset-item:hover {
    background: var(--color-bg-hover, #3a3a4a);
    border-color: var(--color-primary, #4A90E2);
    transform: translateX(4px);
}

.svg-asset-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.svg-asset-info strong {
    color: var(--color-text-primary, #e0e0e0);
    font-size: 14px;
}

.svg-asset-info span {
    color: var(--color-text-secondary, #888);
    font-size: 11px;
}

.svg-asset-actions {
    display: flex;
    gap: 6px;
}

.svg-asset-actions button {
    padding: 6px 10px;
    border: 1px solid var(--color-border, #444);
    border-radius: 6px;
    background: var(--color-bg-primary, #1e1e2e);
    color: var(--color-text-primary, #e0e0e0);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.svg-asset-actions button:hover {
    background: var(--color-primary, #4A90E2);
    color: white;
    transform: scale(1.1);
}

.svg-asset-actions .svg-btn-delete:hover {
    background: #e74c3c;
    border-color: #c0392b;
}

/* Lista de vinculações */
.svg-bindings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bindings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.binding-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--color-bg-secondary, #2a2a3a);
    border: 1px solid var(--color-border, #333);
    border-left: 4px solid var(--color-success, #2ecc71);
    border-radius: 8px;
    transition: all 0.2s;
}

.binding-item:hover {
    background: var(--color-bg-hover, #3a3a4a);
    transform: translateX(4px);
}

.binding-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.binding-info strong {
    color: var(--color-text-primary, #e0e0e0);
    font-size: 14px;
}

.binding-info span {
    color: var(--color-text-secondary, #888);
    font-size: 12px;
}

.svg-btn-delete-binding {
    padding: 6px 10px;
    border: 1px solid var(--color-border, #444);
    border-radius: 6px;
    background: var(--color-bg-primary, #1e1e2e);
    color: var(--color-text-primary, #e0e0e0);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.svg-btn-delete-binding:hover {
    background: #e74c3c;
    border-color: #c0392b;
    color: white;
    transform: scale(1.1);
}

.btn-add-binding {
    padding: 10px 16px;
    background: var(--color-success, #2ecc71);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-add-binding:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* Footer */
.svg-manager-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--color-border, #333);
    background: var(--color-bg-secondary, #2a2a3a);
    border-radius: 0 0 12px 12px;
}

.btn-primary {
    padding: 10px 20px;
    background: var(--color-primary, #4A90E2);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-primary:hover {
    background: #357ABD;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--color-bg-hover, #3a3a4a);
    color: var(--color-text-primary, #e0e0e0);
    border: 1px solid var(--color-border, #444);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-secondary:hover {
    background: var(--color-bg-primary, #1e1e2e);
    border-color: var(--color-primary, #4A90E2);
}

/* Dialog de vinculação */
.svg-binding-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.dialog-content {
    background: var(--color-bg-primary, #1e1e2e);
    border: 1px solid var(--color-border, #333);
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dialog-content h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: var(--color-text-primary, #e0e0e0);
    border-bottom: 2px solid var(--color-primary, #4A90E2);
    padding-bottom: 10px;
}

.dialog-content label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary, #e0e0e0);
}

.dialog-content select,
.dialog-content input[type="text"] {
    padding: 10px;
    border: 1px solid var(--color-border, #444);
    border-radius: 6px;
    background: var(--color-bg-secondary, #2a2a3a);
    color: var(--color-text-primary, #e0e0e0);
    font-size: 14px;
    transition: all 0.2s;
}

.dialog-content select:focus,
.dialog-content input[type="text"]:focus {
    outline: none;
    border-color: var(--color-primary, #4A90E2);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.dialog-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.dialog-actions button:first-child {
    background: var(--color-primary, #4A90E2);
    color: white;
}

.dialog-actions button:first-child:hover {
    background: #357ABD;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.dialog-actions button:last-child {
    background: var(--color-bg-secondary, #2a2a3a);
    color: var(--color-text-primary, #e0e0e0);
    border: 1px solid var(--color-border, #444);
}

.dialog-actions button:last-child:hover {
    background: var(--color-bg-hover, #3a3a4a);
}

/* Container de SVGs renderizados */
#animated-svg-container {
    pointer-events: none;
}

.animated-svg-wrapper {
    position: absolute;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.animated-svg-wrapper:hover {
    border-color: rgba(74, 144, 226, 0.8) !important;
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.3);
}

/* Handle de drag para SVGs */
.svg-drag-handle {
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.9), rgba(56, 189, 248, 0.9));
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px 4px 0 0;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: auto;
    user-select: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.svg-drag-handle:hover {
    background: linear-gradient(135deg, rgba(74, 144, 226, 1), rgba(56, 189, 248, 1));
    cursor: grab;
}

.svg-drag-handle:active {
    cursor: grabbing;
}

/* Indicador de evento vinculado */
.svg-event-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 4px;
    animation: pulse-indicator 2s ease-in-out infinite;
}

@keyframes pulse-indicator {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Responsivo */
@media (max-width: 768px) {
    .svg-manager-body {
        grid-template-columns: 1fr;
    }

    .svg-manager-content {
        width: 95%;
        max-height: 90vh;
    }
}
