/* RESET Y ESTILOS BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
    background: #f0f4f8;
    color: #1e293b;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* HEADER PROFESIONAL */
.header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    padding: 30px 35px;
    border-radius: 30px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 20px 30px -10px rgba(0,0,0,0.2);
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 400;
}

.logo h1 span {
    font-weight: 700;
    color: #fbbf24;
    text-shadow: 0 2px 10px rgba(251, 191, 36, 0.3);
}

.subtitle {
    opacity: 0.9;
    margin-top: 5px;
    font-size: 1.1rem;
}

.badge {
    background: #fbbf24;
    color: #0f172a;
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(251, 191, 36, 0.3);
}

/* ANUNCIOS */
.ad-container {
    background: #e2e8f0;
    border: 2px dashed #94a3b8;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s;
}

.ad-container:hover {
    background: #d1d9e6;
    border-color: #64748b;
}

.ad-horizontal {
    width: 100%;
    min-height: 90px;
    margin: 20px 0;
}

.ad-sidebar {
    width: 100%;
    min-height: 250px;
    margin-bottom: 20px;
}

.ad-sidebar:first-child {
    min-height: 600px;
}

.ad-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-weight: 500;
    padding: 20px;
    text-align: center;
}

.ad-placeholder small {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 5px;
}

/* TABS DE NAVEGACIÓN */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tab-btn {
    background: white;
    border: 1px solid #cbd5e1;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1 1 auto;
}

.tab-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.tab-btn.active {
    background: #1e293b;
    color: white;
    border-color: #1e293b;
}

/* LAYOUT PRINCIPAL */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 25px;
    margin: 25px 0;
}

/* TARJETAS DE CALCULADORA */
.calculator-card {
    background: white;
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 15px 30px -10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.calculator-card h2 {
    color: #0f172a;
    font-size: 1.8rem;
    margin-bottom: 25px;
    border-left: 6px solid #fbbf24;
    padding-left: 20px;
}

/* INPUTS Y FORMULARIOS */
.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 30px;
}

.input-field {
    flex: 1 1 200px;
}

.input-field label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 6px;
}

.input-field input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f8fafc;
}

.input-field input:focus {
    border-color: #fbbf24;
    outline: none;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.15);
    background: white;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 18px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #e2e8f0;
    color: #334155;
}

.btn-primary {
    background: #fbbf24;
    color: #0f172a;
    box-shadow: 0 8px 16px -5px rgba(251, 191, 36, 0.4);
}

.btn-primary:hover {
    background: #f59e0b;
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -5px rgba(251, 191, 36, 0.5);
}

/* RESULTADOS */
.results {
    background: #f8fafc;
    border-radius: 24px;
    padding: 25px;
    margin-top: 20px;
}

/* TABLA DE SUBNETEO */
.subnet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.subnet-table th {
    background: #1e293b;
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 500;
}

.subnet-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    font-family: 'Courier New', monospace;
}

.subnet-table tbody tr:hover {
    background: #f1f5f9;
}

/* INFO DE RED */
.network-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.info-item {
    background: white;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid #e2e8f0;
}

.info-item strong {
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
}

.info-item span {
    font-size: 1.3rem;
    font-weight: 600;
    color: #0f172a;
    font-family: 'Courier New', monospace;
}

.wildcard-info {
    background: #1e293b;
    color: #fbbf24;
    padding: 15px 20px;
    border-radius: 50px;
    font-family: monospace;
    font-size: 1.1rem;
    margin: 15px 0;
}

/* FOOTER */
.footer {
    margin-top: 40px;
    text-align: center;
    color: #64748b;
    padding: 25px;
    border-top: 1px solid #cbd5e1;
}

.footer .small {
    font-size: 0.8rem;
    margin-top: 8px;
}

.footer a {
    color: #1e293b;
    text-decoration: none;
}

/* UTILIDADES */
.text-center {
    text-align: center;
    padding: 30px;
    color: #94a3b8;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.ad-sticky {
    position: sticky;
    top: 20px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
}