/* styles.css - Estilos do Connectopus */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: hidden;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.octopus-logo {
    width: 40px;
    height: 40px;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(2deg); }
}

.app-title {
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.app-subtitle {
    font-size: 12px;
    color: #666;
    margin-left: 5px;
}

/* Toolbar */
.toolbar {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.toolbar button {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.toolbar button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.toolbar input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin: 5px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.toolbar input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    max-width: 350px;
}

.settings-panel h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 600;
}

.setting-item input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.setting-item input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.setting-info {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
    font-style: italic;
}

.setting-preview {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    justify-content: space-between;
}

.preview-box {
    flex: 1;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.reset-btn {
    width: 100%;
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    border: none;
    padding: 10px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Workspace */
.workspace {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    cursor: grab;
    padding-top: 70px;
    touch-action: none;
}

.workspace.dragging {
    cursor: grabbing;
}

.workspace::before {
    content: '';
    position: absolute;
    top: -5000px;
    left: -5000px;
    width: 20000px;
    height: 20000px;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(255, 255, 255, 0.1) 49px, rgba(255, 255, 255, 0.1) 50px),
        repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(255, 255, 255, 0.1) 49px, rgba(255, 255, 255, 0.1) 50px);
    pointer-events: none;
    z-index: 1;
}

/* Card */
.card {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 12px;
    min-width: 150px;
    max-width: 220px;
    cursor: move;
    user-select: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.card.selected {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.card.connect-mode {
    border-color: #ff6b6b;
    border-style: dashed;
}

.card.connecting {
    border-color: #ff6b6b;
    border-style: solid;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

.connect-anchor {
    position: absolute;
    top: 50%;
    right: -10px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.6);
    animation: anchor-pulse 1.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes anchor-pulse {
    0%, 100% { transform: translateY(-50%) scale(1); opacity: 1; }
    50% { transform: translateY(-50%) scale(1.3); opacity: 0.7; }
}

.card.blocked {
    opacity: 0.6;
    border-color: #ff9800;
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.5);
}

.card-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 5px;
}

.card-content {
    color: #666;
    line-height: 1.4;
    font-size: 12px;
}

.card-dependency-info {
    margin-top: 6px;
    padding: 6px;
    background: rgba(255, 152, 0, 0.1);
    border-left: 2px solid #ff9800;
    border-radius: 4px;
    font-size: 10px;
    color: #e65100;
    font-weight: 600;
}

.card-dependency-info.ready {
    background: rgba(76, 175, 80, 0.1);
    border-left-color: #4CAF50;
    color: #2e7d32;
}

.card-actions {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.card-actions button {
    background: none;
    border: 1px solid #ddd;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.3s ease;
}

.card-actions button:hover {
    border-color: #667eea;
    color: #667eea;
    transform: scale(1.05);
}

.card-actions button.done-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
}

.card-actions button.done-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.card-actions button.done-btn:disabled {
    background: linear-gradient(45deg, #999, #888);
    cursor: not-allowed;
    opacity: 0.5;
}

.card-actions button.done-btn:disabled:hover {
    transform: scale(1);
    box-shadow: none;
}

.card-age {
    font-size: 9px;
    color: #999;
    margin-top: 5px;
    font-style: italic;
}

.card-tag-ribbon {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    padding: 4px 8px;
    border-radius: 10px 10px 0 0;
    font-size: 10px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.card-tag-ribbon .tag-emoji {
    font-size: 12px;
}

.card-content-wrapper {
    margin-top: 0;
}

.card.has-tag {
    padding-top: 32px;
}

/* Tag Selector */
.tag-selector {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    max-width: 500px;
    width: 90%;
    display: none;
}

.tag-selector.active {
    display: block;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.tag-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
}

.tag-selector-overlay.active {
    display: block;
}

.tag-selector h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.tag-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.tag-option {
    padding: 12px;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.tag-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.tag-option .tag-emoji {
    font-size: 18px;
}

.tag-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.tag-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tag-remove-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
}

.tag-cancel-btn {
    background: #e0e0e0;
    color: #666;
}

.tag-remove-btn:hover, .tag-cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.card-actions button.tag-btn {
    background: linear-gradient(45deg, #8B5CF6, #7C3AED);
    color: white;
    border: none;
}

.card-actions button.tag-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* Connection Arrows */
.connection-arrow {
    position: absolute;
    pointer-events: none;
    z-index: 50;
}

.connection-arrow path {
    fill: none;
    stroke: #ff6b6b;
    stroke-width: 3;
    filter: drop-shadow(0 2px 4px rgba(255, 107, 107, 0.4));
}

.connection-arrow polygon {
    fill: #ff6b6b;
    filter: drop-shadow(0 2px 4px rgba(255, 107, 107, 0.4));
}

.connection-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ff6b6b;
    border: 3px solid white;
    border-radius: 50%;
    z-index: 60;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Coordinates Display */
.coordinates-display {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 12px;
    color: #666;
    font-family: monospace;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Legend */
.legend {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 15px;
    font-size: 12px;
    color: #666;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 250px;
}

.legend h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.legend-arrow {
    width: 40px;
    height: 20px;
}

.legend-text {
    flex: 1;
}

/* Completed Stack */
.empty-message {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
    font-size: 14px;
}

/* Animations */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 9999;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0) translateY(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px) translateY(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(5px) translateY(2px); }
}

.card.shaking {
    animation: shake 0.6s ease-in-out;
}

/* Lightning Effect */
.lightning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    animation: lightning-fade 0.4s ease-out forwards;
}

@keyframes lightning-fade {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 0; }
}

.lightning-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: 9998;
    animation: flash 0.4s ease-out forwards;
}

@keyframes flash {
    0% { opacity: 0; }
    10% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 10px 15px;
    }
    
    .app-title {
        font-size: 20px;
    }
    
    .octopus-logo {
        width: 32px;
        height: 32px;
    }
    
    .toolbar {
        position: relative;
        width: calc(100% - 40px);
        margin: 10px 20px;
        border-radius: 10px;
        top: 0;
        left: 0;
    }

    .settings-panel {
        position: relative;
        width: calc(100% - 40px);
        margin: 10px 20px;
        top: 0;
        right: 0;
    }

    .workspace {
        padding-top: 200px;
    }

    .coordinates-display {
        font-size: 10px;
        padding: 6px 10px;
    }

    .legend {
        display: none;
    }
}
