/* Responsive Design - Mobile First Approach */

/* Tablet Styles */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 3rem;
    }
    
    .main-grid {
        gap: 20px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .feature-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    /* Grid Layout Mobile */
    .main-grid, 
    .info-sections {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    /* Tabs Mobile */
    .tabs {
        flex-direction: column;
        gap: 10px;
    }
    
    .tab {
        text-align: center;
        border-radius: 10px;
    }
    
    /* Cards Mobile */
    .card {
        padding: 20px;
    }
    
    .card h2 {
        font-size: 1.5rem;
    }
    
    /* Form Elements Mobile */
    input, select {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Export Section Mobile */
    .export-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .export-btn {
        width: 100%;
        text-align: center;
    }
    
    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
    
    .footer-section ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    /* Info Items Mobile */
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .info-value {
        max-width: 100%;
        text-align: left;
        word-break: break-word;
    }
    
    /* Table Mobile */
    .subnet-table {
        font-size: 12px;
    }
    
    .subnet-table th,
    .subnet-table td {
        padding: 8px;
    }
    
    /* Modal Mobile */
    #modal > div {
        max-width: 95%;
        max-height: 90%;
        padding: 20px;
    }
    
    /* Feature Grid Mobile */
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-item {
        padding: 20px;
    }
    
    /* IP Version Toggle Mobile */
    .ip-version-toggle {
        flex-direction: column;
    }
    
    .ip-version-btn {
        padding: 15px;
        border-radius: 0;
    }
    
    .ip-version-btn:first-child {
        border-radius: 12px 12px 0 0;
    }
    
    .ip-version-btn:last-child {
        border-radius: 0 0 12px 12px;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .header::before {
        width: 60px;
        height: 3px;
    }
    
    .card {
        padding: 15px;
    }
    
    .card h2 {
        font-size: 1.3rem;
    }
    
    input, select {
        padding: 10px;
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .result-card {
        padding: 15px;
    }
    
    .result-card .value {
        font-size: 1.2rem;
    }
    
    .txt-output {
        min-height: 200px;
        font-size: 11px;
    }
    
    .footer {
        padding: 20px 0 10px 0;
    }
    
    .footer-section h3 {
        font-size: 1rem;
    }
    
    .footer-section p,
    .footer-section li {
        font-size: 0.9rem;
    }
}

/* Landscape Phone Styles */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .tab-container {
        margin-bottom: 20px;
    }
    
    .tabs {
        flex-direction: row;
        justify-content: center;
        gap: 5px;
    }
    
    .tab {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .floating-particles,
    .footer,
    .tabs,
    .btn,
    #modal {
        display: none;
    }
    
    .card {
        background: white;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .subnet-table {
        background: white;
    }
    
    .subnet-table th {
        background: #f0f0f0;
        color: black;
    }
}

/* High DPI / Retina Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .header::before {
        background-size: contain;
    }
    
    .icon {
        background-size: contain;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-particles {
        display: none;
    }
    
    .card::before {
        animation: none;
    }
}

/* Dark Mode Support (if user prefers dark) */
@media (prefers-color-scheme: dark) {
    /* Already dark theme, no changes needed */
}

/* Light Mode Support (if user prefers light) */
@media (prefers-color-scheme: light) {
    /* Could add light theme overrides here if needed */
}