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

:root {
    /* Cores Factorio */
    --factorio-dark: #1a1a1a;
    --factorio-darker: #0f0f0f;
    --factorio-panel: #2d2d2d;
    --factorio-border: #4a4a4a;
    --factorio-copper: #e67e22;
    --factorio-copper-light: #f39c12;
    --factorio-energy: #2ecc71;
    --factorio-energy-dark: #27ae60;
    --factorio-fluid: #3498db;
    --factorio-danger: #e74c3c;
    --factorio-warning: #f1c40f;
    --factorio-text: #ecf0f1;
    --factorio-text-dim: #bdc3c7;
    --factorio-metal: #7f8c8d;
    
    /* Efeitos */
    --glow-copper: 0 0 10px rgba(230, 126, 34, 0.5), 0 0 20px rgba(230, 126, 34, 0.3);
    --glow-energy: 0 0 10px rgba(46, 204, 113, 0.5), 0 0 20px rgba(46, 204, 113, 0.3);
    --glow-danger: 0 0 10px rgba(231, 76, 60, 0.5), 0 0 20px rgba(231, 76, 60, 0.3);
}

body {
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    background: linear-gradient(135deg, var(--factorio-darker) 0%, var(--factorio-dark) 100%);
    background-attachment: fixed;
    color: var(--factorio-text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

/* Textura sutil de fundo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

header {
    background: linear-gradient(135deg, var(--factorio-panel) 0%, #252525 100%);
    padding: 20px 30px;
    border: 2px solid var(--factorio-border);
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--factorio-copper), var(--factorio-copper-light), var(--factorio-copper));
    box-shadow: var(--glow-copper);
}

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

.header-logo-img {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 0 8px rgba(230, 126, 34, 0.6));
    transition: transform 0.3s;
}

.header-logo-img:hover {
    transform: scale(1.1) rotate(5deg);
}

header h1 {
    font-size: 28px;
    color: var(--factorio-copper-light);
    text-shadow: 0 0 10px rgba(230, 126, 34, 0.5);
    font-weight: bold;
    letter-spacing: 1px;
    margin: 0;
}

.header-info {
    color: var(--factorio-text-dim);
    font-size: 13px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--factorio-text-dim);
    padding: 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    position: relative;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--factorio-border);
    color: var(--factorio-text);
    transform: scale(1.1);
}

.header-btn:active {
    transform: scale(0.95);
}

.header-btn-danger {
    border-color: rgba(231, 76, 60, 0.3);
    color: rgba(231, 76, 60, 0.7);
}

.header-btn-danger:hover {
    border-color: var(--factorio-danger);
    background: rgba(231, 76, 60, 0.1);
    color: var(--factorio-danger);
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.3);
}

.header-btn.loading {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.header-btn span {
    display: block;
    line-height: 1;
}

/* Tooltip customizado */
.header-btn::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: var(--factorio-panel);
    color: var(--factorio-text);
    padding: 6px 10px;
    border-radius: 3px;
    border: 1px solid var(--factorio-border);
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1000;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.header-btn::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--factorio-border);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1001;
}

.header-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.header-btn:hover::before {
    opacity: 1;
}

section {
    background: linear-gradient(135deg, var(--factorio-panel) 0%, #252525 100%);
    padding: 25px;
    border: 2px solid var(--factorio-border);
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    margin-bottom: 30px;
    position: relative;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--factorio-metal), transparent);
}

section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--factorio-copper-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(230, 126, 34, 0.4);
    border-bottom: 1px solid var(--factorio-border);
    padding-bottom: 10px;
}

.section-title-with-icon {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--factorio-copper-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(230, 126, 34, 0.4);
    border-bottom: 1px solid var(--factorio-border);
    padding-bottom: 10px;
}

.section-icon-img {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 0 6px rgba(230, 126, 34, 0.5));
}

/* Métricas do Sistema */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.metric-card {
    padding: 20px;
    border: 2px solid var(--factorio-border);
    border-radius: 4px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    /* Textura de slot do Factorio */
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(255, 255, 255, 0.02) 1px, rgba(255, 255, 255, 0.02) 2px),
        repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255, 255, 255, 0.02) 1px, rgba(255, 255, 255, 0.02) 2px);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--factorio-copper);
    box-shadow: var(--glow-copper);
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.metric-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 4px rgba(230, 126, 34, 0.6));
}

.metric-icon-img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 0 6px rgba(230, 126, 34, 0.5));
    transition: transform 0.2s;
}

.metric-icon-img:hover {
    transform: scale(1.1);
}

.metric-title {
    font-weight: bold;
    color: var(--factorio-text);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 13px;
}

.metric-value {
    font-size: 36px;
    font-weight: bold;
    color: var(--factorio-copper-light);
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(230, 126, 34, 0.6);
    font-family: 'Courier New', monospace;
}

.metric-details {
    font-size: 12px;
    color: var(--factorio-text-dim);
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-family: 'Courier New', monospace;
}

.metric-details.port-list,
.metric-details.url-list {
    display: block;
    max-height: 60px;
    overflow-y: auto;
    word-break: break-all;
    line-height: 1.4;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--factorio-darker);
    border: 1px solid var(--factorio-border);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--factorio-copper), var(--factorio-copper-light));
    transition: width 0.5s ease;
    box-shadow: var(--glow-copper);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill.warning {
    background: linear-gradient(90deg, var(--factorio-warning), #f39c12);
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.progress-fill.danger {
    background: linear-gradient(90deg, var(--factorio-danger), #c0392b);
    box-shadow: var(--glow-danger);
}

/* Serviços */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.service-card {
    border: 2px solid var(--factorio-border);
    border-radius: 4px;
    padding: 20px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Estilo de slot do Factorio */
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(255, 255, 255, 0.02) 1px, rgba(255, 255, 255, 0.02) 2px),
        repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255, 255, 255, 0.02) 1px, rgba(255, 255, 255, 0.02) 2px);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--factorio-metal);
    transition: all 0.3s;
    box-shadow: 0 0 4px rgba(127, 140, 141, 0.3);
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%, rgba(0, 0, 0, 0.2) 100%);
}

.service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 20px rgba(230, 126, 34, 0.3), inset 0 0 30px rgba(230, 126, 34, 0.1);
    border-color: var(--factorio-copper);
}

.service-card:hover::before {
    background: var(--factorio-copper);
    box-shadow: var(--glow-copper);
    width: 5px;
}

.service-card:hover::after {
    border-color: rgba(230, 126, 34, 0.2);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.service-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.service-icon-img {
    width: 36px;
    height: 36px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 0 4px rgba(230, 126, 34, 0.4));
    transition: transform 0.2s;
    flex-shrink: 0;
}

.service-icon-img:hover {
    transform: scale(1.1) rotate(5deg);
}

.service-name {
    font-size: 18px;
    font-weight: bold;
    color: var(--factorio-text);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
}

.service-status {
    padding: 4px 12px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid;
    font-family: 'Courier New', monospace;
    position: relative;
}

.service-status.active {
    background: rgba(46, 204, 113, 0.2);
    color: var(--factorio-energy);
    border-color: var(--factorio-energy);
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

.service-status.active::before {
    content: '●';
    position: absolute;
    left: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.service-status.inactive {
    background: rgba(231, 76, 60, 0.2);
    color: var(--factorio-danger);
    border-color: var(--factorio-danger);
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.3);
}

.service-description {
    color: var(--factorio-text-dim);
    font-size: 13px;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
}

.service-info {
    font-size: 11px;
    color: var(--factorio-text-dim);
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
}

.service-info code {
    background: var(--factorio-darker);
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid var(--factorio-border);
    color: var(--factorio-copper-light);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
    font-family: 'Courier New', monospace;
}

.ip-copy-container {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ip-copy-container label {
    font-size: 11px;
    color: var(--factorio-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ip-copy-wrapper {
    display: flex;
    gap: 5px;
    align-items: center;
}

.ip-copy-input {
    flex: 1;
    background: var(--factorio-darker);
    border: 1px solid var(--factorio-border);
    padding: 6px 10px;
    color: var(--factorio-copper-light);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    border-radius: 2px;
    cursor: text;
}

.ip-copy-input:focus {
    outline: none;
    border-color: var(--factorio-fluid);
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.btn-copy {
    background: var(--factorio-dark);
    border: 1px solid var(--factorio-border);
    color: var(--factorio-copper-light);
    padding: 6px 12px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    font-family: 'Courier New', monospace;
}

.btn-copy:hover {
    background: var(--factorio-darker);
    border-color: var(--factorio-fluid);
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.service-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.service-actions-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.service-actions-primary .btn {
    flex: 1 1 calc(25% - 6px);
    min-width: 90px;
}

.service-actions-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.service-actions-secondary .btn {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 100px;
}

.btn {
    padding: 10px 16px;
    border: 2px solid;
    border-radius: 2px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    /* Estilo de botão do Factorio */
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%, rgba(0, 0, 0, 0.1) 100%);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    pointer-events: none;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.btn-primary {
    background: linear-gradient(135deg, var(--factorio-copper), var(--factorio-copper-light));
    color: var(--factorio-darker);
    border-color: var(--factorio-copper-light);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: var(--glow-copper);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--factorio-energy), var(--factorio-energy-dark));
    color: white;
    border-color: var(--factorio-energy);
}

.btn-success:hover:not(:disabled) {
    box-shadow: var(--glow-energy);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--factorio-danger), #c0392b);
    color: white;
    border-color: var(--factorio-danger);
}

.btn-danger:hover:not(:disabled) {
    box-shadow: var(--glow-danger);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--factorio-metal), #5d6d7e);
    color: white;
    border-color: var(--factorio-metal);
}

.btn-secondary:hover:not(:disabled) {
    box-shadow: 0 0 10px rgba(127, 140, 141, 0.5);
    transform: translateY(-2px);
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: auto;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, var(--factorio-panel) 0%, #252525 100%);
    margin: 20px;
    border: 2px solid var(--factorio-border);
    border-radius: 4px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    /* Textura de slot do Factorio */
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(255, 255, 255, 0.015) 1px, rgba(255, 255, 255, 0.015) 2px),
        repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255, 255, 255, 0.015) 1px, rgba(255, 255, 255, 0.015) 2px),
        linear-gradient(135deg, var(--factorio-panel) 0%, #252525 100%);
}

.modal-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, transparent 50%, rgba(0, 0, 0, 0.15) 100%);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--factorio-copper), var(--factorio-copper-light), var(--factorio-copper));
    box-shadow: var(--glow-copper);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 2px solid var(--factorio-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    /* Textura sutil no header */
    background-image: 
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255, 255, 255, 0.02) 2px, rgba(255, 255, 255, 0.02) 4px),
        rgba(0, 0, 0, 0.3);
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(230, 126, 34, 0.3), transparent);
}

.modal-header h3 {
    font-size: 18px;
    color: var(--factorio-copper-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 8px rgba(230, 126, 34, 0.5);
}

.close-btn {
    background: transparent;
    border: 2px solid var(--factorio-border);
    font-size: 24px;
    color: var(--factorio-text-dim);
    cursor: pointer;
    padding: 4px 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--factorio-danger);
    border-color: var(--factorio-danger);
    color: white;
    box-shadow: var(--glow-danger);
}

.modal-body {
    padding: 20px 25px;
    overflow-y: auto;
    flex: 1;
    background: rgba(0, 0, 0, 0.1);
}

.logs-actions {
    margin-bottom: 15px;
}

.logs-container {
    background: var(--factorio-darker);
    color: var(--factorio-energy);
    padding: 15px;
    border: 2px solid var(--factorio-border);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.8;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 4px rgba(46, 204, 113, 0.3);
}

.logs-container .loading {
    color: var(--factorio-text-dim);
}

/* Scrollbar personalizada */
.logs-container::-webkit-scrollbar {
    width: 8px;
}

.logs-container::-webkit-scrollbar-track {
    background: var(--factorio-darker);
    border-left: 1px solid var(--factorio-border);
}

.logs-container::-webkit-scrollbar-thumb {
    background: var(--factorio-copper);
    border-radius: 2px;
}

.logs-container::-webkit-scrollbar-thumb:hover {
    background: var(--factorio-copper-light);
    box-shadow: 0 0 8px rgba(230, 126, 34, 0.6);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--factorio-panel), #252525);
    color: var(--factorio-text);
    border: 2px solid var(--factorio-border);
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 2000;
    max-width: 400px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
    font-weight: bold;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: linear-gradient(135deg, var(--factorio-energy), var(--factorio-energy-dark));
    border-color: var(--factorio-energy);
    box-shadow: var(--glow-energy);
}

.toast.error {
    background: linear-gradient(135deg, var(--factorio-danger), #c0392b);
    border-color: var(--factorio-danger);
    box-shadow: var(--glow-danger);
}

.loading {
    text-align: center;
    color: var(--factorio-text-dim);
    padding: 20px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Action Items */
.action-item {
    border: 2px solid var(--factorio-border);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    position: relative;
    transition: all 0.2s;
    /* Textura de slot do Factorio */
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(255, 255, 255, 0.02) 1px, rgba(255, 255, 255, 0.02) 2px),
        repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255, 255, 255, 0.02) 1px, rgba(255, 255, 255, 0.02) 2px),
        linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.action-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--factorio-metal);
    box-shadow: 0 0 4px rgba(127, 140, 141, 0.3);
    transition: all 0.2s;
}

.action-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%, rgba(0, 0, 0, 0.1) 100%);
}

.action-item:hover {
    transform: translateX(2px);
    border-color: var(--factorio-copper);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 15px rgba(230, 126, 34, 0.2);
}

.action-item:hover::before {
    background: var(--factorio-copper);
    box-shadow: var(--glow-copper);
    width: 5px;
}

.action-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.action-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-icon-img {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 0 4px rgba(230, 126, 34, 0.4));
    flex-shrink: 0;
}

.action-header h4 {
    color: var(--factorio-copper-light);
    margin: 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-description {
    color: var(--factorio-text-dim);
    font-size: 12px;
    margin-bottom: 12px;
    font-family: 'Courier New', monospace;
}

.action-item .btn {
    width: 100%;
    margin-top: 8px;
}

/* Link Items */
.link-item {
    border: 2px solid var(--factorio-border);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    position: relative;
    transition: all 0.2s;
    /* Textura de slot do Factorio */
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(255, 255, 255, 0.02) 1px, rgba(255, 255, 255, 0.02) 2px),
        repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255, 255, 255, 0.02) 1px, rgba(255, 255, 255, 0.02) 2px),
        linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.link-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--factorio-fluid);
    box-shadow: 0 0 4px rgba(52, 152, 219, 0.3);
    transition: all 0.2s;
}

.link-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%, rgba(0, 0, 0, 0.1) 100%);
}

.link-item:hover {
    transform: translateX(2px);
    border-color: var(--factorio-fluid);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 15px rgba(52, 152, 219, 0.2);
}

.link-item:hover::before {
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
    width: 5px;
}

.link-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.link-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-icon-img {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 0 4px rgba(230, 126, 34, 0.4));
    flex-shrink: 0;
}

.link-header h4 {
    color: var(--factorio-copper-light);
    margin: 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.link-port {
    color: var(--factorio-text-dim);
    font-size: 11px;
    font-family: 'Courier New', monospace;
    background: var(--factorio-darker);
    padding: 4px 8px;
    border-radius: 2px;
    border: 1px solid var(--factorio-border);
}

.link-description {
    color: var(--factorio-text-dim);
    font-size: 12px;
    margin-bottom: 12px;
    font-family: 'Courier New', monospace;
}

.link-actions {
    display: flex;
    gap: 10px;
}

.link-actions .btn {
    flex: 1;
    margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
