/* ============================================
   IPv4 Subnet Calculator - Network.css
   Temiz, Optimize Son
   ============================================ */

/* === 1. RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    min-height: 100%;
    background: rgb(75, 75, 75);
    font-family: "Chakra Petch", sans-serif, Arial, sans-serif;
    color: white;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.6;
}

/* === 2. KATMANLAMA (Z-INDEX) === */

/* Particles.js - En Arka Katman */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Floating Numbers - Orta Katman */
.floating-numbers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

/* Container - En Ön Katman */
.container {
    position: relative;
    z-index: 3;
    max-width: 900px;
    margin: 30px auto;
    padding: 30px;
    background-color: rgba(29, 29, 29, 0.92);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* === 3. FLOATING NUMBERS ANİMASYON === */
.number {
    position: absolute;
    bottom: -50px;
    font-size: 2rem;
    color: rgba(74, 144, 226, 0.15);
    animation: floatUp linear infinite;
    user-select: none;
    font-weight: 300;
    will-change: transform, opacity;
}

@keyframes floatUp {
    from {
        transform: translateY(0) translateZ(0);
        opacity: 0.15;
    }
    to {
        transform: translateY(-100vh) translateZ(0);
        opacity: 0;
    }
}

/* === 4. TİPOGRAFİ === */
h1, h2, h3 {
    color: #4a90e2;
    border-bottom: 2px solid #4a90e2;
    padding-bottom: 8px;
    margin-bottom: 20px;
    font-weight: 600;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.4rem;
    margin-top: 25px;
}

/* === 5. FORM STİLLERİ === */
#subnetForm {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
}

label {
    font-weight: 600;
    color: #e0e0e0;
    font-size: 1rem;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #555;
    border-radius: 6px;
    background-color: #2a2a2a;
    color: #e0e0e0;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

input[type="text"]:hover,
select:hover {
    border-color: #666;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #4a90e2;
    background-color: #333;
}

input[type="text"]::placeholder {
    color: #888;
}

/* === 6. BUTTON STİLLERİ === */
button {
    grid-column: 1 / -1;
    padding: 14px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

button:active {
    transform: translateY(0);
}

button:focus-visible {
    outline: 2px solid #4a90e2;
    outline-offset: 3px;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === 7. RESULTS STİLLERİ === */
.results {
    margin-top: 25px;
}

.results p {
    background-color: #2a2a2a;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 4px solid #4a90e2;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    word-wrap: break-word;
    transition: background-color 0.3s ease;
}

.results p:hover {
    background-color: #333;
}

.results p strong {
    color: #4a90e2;
    font-weight: 600;
}

/* === 8. TABLE STİLLERİ === */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 20px;
    border-radius: 6px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table caption {
    caption-side: top;
    font-size: 1.2rem;
    font-weight: 600;
    color: #4a90e2;
    margin-bottom: 15px;
    text-align: left;
}

.table th,
.table td {
    border: 1px solid #555;
    padding: 12px 15px;
    text-align: left;
}

.table thead {
    background-color: #4a90e2;
    color: #121212;
    font-weight: 700;
}

.table tbody tr:nth-child(odd) {
    background-color: #2a2a2a;
}

.table tbody tr:nth-child(even) {
    background-color: #252525;
}

.table tbody tr:hover {
    background-color: #333;
    transition: background-color 0.2s ease;
}

.table tbody tr td[colspan] {
    background-color: #357abd;
    color: white;
    font-weight: 600;
    text-align: center;
}

/* === 9. ERROR MESSAGE === */
.error-message {
    background-color: rgba(231, 76, 60, 0.2);
    border-left: 4px solid #e74c3c;
    color: #ff6b6b;
    padding: 12px 15px;
    border-radius: 6px;
    margin-top: 15px;
    font-weight: 500;
    display: none;
}

.error-message.show {
    display: block;
    animation: slideIn 0.3s ease;
}

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

/* === 10. FOOTER === */
footer {
    position: relative;
    z-index: 3;
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.footer-links a {
    color: #4a90e2;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #357abd;
    text-decoration: underline;
}

/* === 11. RESPONSIVE DESIGN === */

/* Tablet (768px ve altı) */
@media (max-width: 768px) {
    .container {
        margin: 20px 15px;
        padding: 20px 15px;
    }

    #subnetForm {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .number {
        font-size: 1.5rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    .results p {
        font-size: 0.95rem;
        padding: 10px 12px;
    }

    .table {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 8px 10px;
    }

    button {
        font-size: 1rem;
        padding: 12px;
    }
}

/* Mobile (480px ve altı) */
@media (max-width: 480px) {
    .container {
        margin: 10px;
        padding: 15px 12px;
    }

    h1 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .number {
        font-size: 1.2rem;
    }

    input[type="text"],
    select {
        padding: 10px;
        font-size: 0.95rem;
    }

    button {
        padding: 10px;
        font-size: 0.95rem;
    }

    .results p {
        font-size: 0.9rem;
        padding: 8px 10px;
    }

    .table {
        font-size: 0.8rem;
    }

    .table th,
    .table td {
        padding: 6px 8px;
    }
}

/* === 12. UTILITY CLASSES === */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* === 13. PRINT STYLES === */
@media print {
    body {
        background: white;
        color: black;
    }

    #particles-js,
    .floating-numbers,
    button {
        display: none;
    }

    .container {
        box-shadow: none;
        background: white;
        color: black;
    }

    .table th {
        background-color: #ddd !important;
        color: black !important;
    }
}

/* === 14. ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    button {
        border: 2px solid white;
    }

    input[type="text"]:focus,
    select:focus {
        border-width: 3px;
    }
}

/* === 15. SCROLL BAR STYLING (Optional) === */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #4a90e2;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #357abd;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #4a90e2 #2a2a2a;
}