/* Home Networks Specific Styles - Mobile First */

.content-section ul,
.content-section ol {
    margin: 1rem 0 1rem 1.5rem;
}

.content-section li {
    margin-bottom: 0.8rem;
    line-height: 1.7;
}

.content-section strong {
    color: var(--color-accent);
}

/* Network Canvas - Mobile First (Stacked Layout) */
.network-canvas {
    position: relative;
    min-height: 600px;
    background: radial-gradient(circle at center, rgba(177, 153, 119, 0.05), transparent 70%);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

/* Tablet and up - Grid Layout */
@media (min-width: 768px) {
    .network-canvas {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: var(--spacing-md);
        min-height: 500px;
        padding: var(--spacing-xl);
    }
}

/* Desktop - Larger Grid */
@media (min-width: 1024px) {
    .network-canvas {
        min-height: 600px;
        gap: var(--spacing-lg);
    }
}

/* Connection Lines SVG */
.connection-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.connection-line {
    stroke-dasharray: 5, 5;
    animation: dash 20s linear infinite;
    filter: drop-shadow(0 0 3px rgba(177, 153, 119, 0.5));
}

@keyframes dash {
    to {
        stroke-dashoffset: -1000;
    }
}

/* Router - Center Position */
.router {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--color-overlay-80);
    border: 3px solid var(--color-accent);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: 0 0 30px rgba(177, 153, 119, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(177, 153, 119, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(177, 153, 119, 0.6);
    }
}

/* Grid positioning for desktop */
@media (min-width: 768px) {
    .router {
        grid-column: 2;
        grid-row: 2;
    }
}

.router svg {
    width: 60px;
    height: 60px;
    margin-bottom: var(--spacing-xs);
}

@media (min-width: 768px) {
    .router svg {
        width: 70px;
        height: 70px;
    }
}

.router p {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--color-accent);
    font-weight: 700;
    margin: 0;
}

.ip-label {
    font-size: 0.75rem;
    color: var(--color-light-tan);
    font-family: 'Courier New', monospace;
    display: block;
    margin-top: 0.3rem;
}

/* Devices - Mobile Stacked */
.device {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--color-overlay-63);
    border: 2px solid var(--color-dark-tan);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
    width: 100%;
    max-width: 280px;
}

/* Grid positioning for desktop */
@media (min-width: 768px) {
    .device {
        max-width: none;
        width: auto;
    }
    
    .laptop {
        grid-column: 1;
        grid-row: 1;
    }
    
    .phone {
        grid-column: 3;
        grid-row: 1;
    }
    
    .tablet {
        grid-column: 1;
        grid-row: 3;
    }
    
    .tv {
        grid-column: 3;
        grid-row: 3;
    }
}

.device svg {
    width: 50px;
    height: 50px;
    color: var(--color-tan);
    margin-bottom: var(--spacing-xs);
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .device svg {
        width: 60px;
        height: 60px;
    }
}

.device p {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--color-light-tan);
    margin: 0.5rem 0;
    font-weight: 600;
}

.device-status {
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    background: rgba(106, 92, 72, 0.3);
    color: var(--color-dark-tan);
    margin-top: 0.3rem;
}

.device.connected {
    border-color: var(--color-accent);
    background: var(--color-overlay-80);
    box-shadow: 0 0 20px rgba(177, 153, 119, 0.3);
}

.device.connected svg {
    color: var(--color-accent);
}

.device.connected .device-status {
    background: var(--color-accent);
    color: var(--color-black);
    font-weight: 600;
}

.device.connected .ip-label {
    display: block;
}

.device:not(.connected) .ip-label {
    display: none;
}

/* Touch feedback */
.device:active {
    transform: scale(0.95);
}

/* Hover effects for desktop */
@media (hover: hover) {
    .device:hover {
        transform: translateY(-5px);
        border-color: var(--color-accent);
    }
    
    .device:hover svg {
        transform: scale(1.1);
    }
}

/* Network Info Section - Mobile First */
.network-info {
    background: var(--color-overlay-63);
    border: 2px solid var(--color-dark-tan);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.network-info h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--color-accent);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.connected-count {
    font-size: 1.1rem;
    color: var(--color-light-tan);
    margin-bottom: var(--spacing-md);
}

.connected-count span {
    font-family: var(--font-display);
    color: var(--color-accent);
    font-weight: 700;
    font-size: 1.3rem;
}

.device-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.device-item {
    background: var(--color-overlay-88);
    padding: var(--spacing-sm);
    border-radius: 8px;
    border-left: 3px solid var(--color-accent);
    animation: slideIn 0.3s ease-out;
}

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

.device-item-name {
    font-weight: 600;
    color: var(--color-accent);
    font-family: var(--font-display);
}

.device-item-ip {
    font-size: 0.85rem;
    color: var(--color-light-tan);
    font-family: 'Courier New', monospace;
}

/* Data packet animation */
@keyframes packetFlow {
    0% {
        stroke-dashoffset: 1000;
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 0.3;
    }
}

.connection-line.active {
    animation: dash 20s linear infinite, packetFlow 2s ease-in-out infinite;
}
