:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --accent-color: #4fc3dc;
    --text-color: #333;
    --light-text: #8d99ae;
    --background: #f8f9fa;
    --card-bg: #ffffff;
    --success: #28a745;
    --error: #dc3545;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

.app-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.header p {
    color: var(--light-text);
    margin-top: 0;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    /* Eliminamos la transición de movimiento */
}

/* Eliminamos el efecto de elevación al pasar el cursor */

.card-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.card-body {
    padding: 1.5rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.input-group input {
    flex: 1;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    min-width: 300px;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.2);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    margin: 0 auto;
    box-shadow: 0 4px 6px rgba(74, 111, 165, 0.3);
}

.btn-secondary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    margin: 1.5rem auto;
    box-shadow: 0 4px 6px rgba(74, 111, 165, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 6px 12px rgba(74, 111, 165, 0.4);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 6px 12px rgba(74, 111, 165, 0.4);
    /* Eliminamos el movimiento vertical */
}

.btn-active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-box {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: var(--border-radius);
    padding: 1rem;
    min-height: 100px;
}

.service-info {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    animation: slideIn 0.3s ease-out;
}

.service-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.service-protocol {
    color: var(--light-text);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.service-description {
    margin-top: 0.5rem;
}

.error-message {
    color: var(--error);
    font-weight: 500;
}

.success-message {
    color: var(--success);
    font-weight: 500;
}

.footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    color: var(--light-text);
    font-size: 0.9rem;
}

/* Animaciones y elementos nuevos */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity var(--transition-speed);
}

.loading-overlay.fade-out {
    opacity: 0;
}

.spinner {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    animation: spin 1s infinite linear;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Estilo para los contenedores de resultados con spinner */
#port-result .spinner, #random-result .spinner {
    font-size: 2rem;
    margin: 1rem 0;
}

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

.notification {
    position: fixed;
    top: 20px;
    right: -300px;
    width: 280px;
    padding: 15px;
    border-radius: var(--border-radius);
    background-color: var(--card-bg);
    box-shadow: var(--box-shadow);
    z-index: 1000;
    transition: right var(--transition-speed);
}

.notification.show {
    right: 20px;
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--error);
}

.notification.info {
    border-left: 4px solid var(--info-color);
}

.notification p {
    margin: 0;
    font-size: 0.9rem;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    min-width: 120px;
    /* Eliminamos la transición de movimiento */
}

/* Eliminamos el efecto de elevación al pasar el cursor */

.stat-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--light-text);
    text-align: center;
}

/* Eliminamos las clases redundantes ya que ahora usamos .spinner en todas partes */

.result-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.result-title i {
    color: var(--success);
}

.no-results {
    text-align: center;
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: var(--border-radius);
}

.no-results i {
    font-size: 2rem;
    color: var(--info-color);
    margin-bottom: 1rem;
}

.suggestion {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-top: 0.5rem;
}

.port-result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

.port-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 1rem 0;
    padding: 0.5rem 1.5rem;
    background-color: rgba(74, 111, 165, 0.1);
    border-radius: var(--border-radius);
}

.port-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-action {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    border: none;
    color: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(74, 111, 165, 0.3);
    transition: background-color var(--transition-speed), color var(--transition-speed), box-shadow var(--transition-speed);
    /* Solo transición de color, no de movimiento */
}

.btn-action:hover {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 6px 12px rgba(74, 111, 165, 0.4);
    /* Eliminamos el movimiento vertical */
}

.service-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.suggestions-container {
    margin-bottom: 1.5rem;
}

.suggestions-title {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-bottom: 0.5rem;
}

.suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-item {
    background-color: var(--card-bg);
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* Eliminamos la transición */
}

.suggestion-item:hover {
    background-color: rgba(74, 111, 165, 0.1);
    border-color: var(--primary-color);
    /* Sin movimiento al pasar el cursor */
}

.suggestion-item .port-number {
    font-size: 0.9rem;
    margin: 0;
    padding: 0;
    background-color: transparent;
}

.suggestion-item .port-name {
    font-size: 0.8rem;
    color: var(--light-text);
}

.error-container {
    text-align: center;
    padding: 3rem;
}

.error-icon {
    font-size: 4rem;
    color: var(--error);
    margin-bottom: 1.5rem;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .stats-container {
        flex-direction: column;
    }
    
    .stat-item {
        width: 100%;
    }
    
    .port-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-action {
        width: 100%;
        justify-content: center;
    }
}