/* Custom CSS for DNS Lookup Tool */

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --light-bg: #f8f9fa;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* Use system font stack to avoid external font requests. */

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, system-ui, sans-serif;
    font-weight: 300;
    letter-spacing: 0.3px;
    min-height: 100vh;
}

/* Card Styling */
.card {
    border-radius: 15px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    border-bottom: none;
}

/* Form Styling */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.input-group-text {
    border-radius: 10px 0 0 10px;
    border: 2px solid #e9ecef;
    border-right: none;
}

.form-control.border-start-0 {
    border-left: none;
    border-radius: 0 10px 10px 0;
}

/* Button Styling */
.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #5dade2);
    border: none;
    border-radius: 12px;
    font-weight: 400;
    transition: all 0.3s ease;
    letter-spacing: 0.8px;
    font-size: 0.95rem;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #2980b9, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Alert Styling */
.alert {
    border: none;
    border-radius: 10px;
    font-weight: 500;
}

.alert-danger {
    background: linear-gradient(45deg, #ff6b6b, #ff5252);
    color: white;
}

.alert-success {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
}

/* Badge Styling */
.badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

/* Typography */
.text-primary {
    color: var(--primary-color) !important;
}

/* Apply thin font weight throughout */
h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, system-ui, sans-serif;
    font-weight: 400;
    letter-spacing: -0.3px;
}

.card-title {
    font-weight: 500;
    letter-spacing: -0.2px;
}

.form-label {
    font-weight: 400;
    letter-spacing: 0.2px;
}

.btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, system-ui, sans-serif;
    font-weight: 400;
    letter-spacing: 0.3px;
}

small, .small {
    font-weight: 300;
    letter-spacing: 0.1px;
}

.badge {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, system-ui, sans-serif;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.alert {
    font-weight: 300;
    letter-spacing: 0.1px;
}

/* Improve readability */
p, .text-muted {
    font-weight: 300;
    line-height: 1.6;
    letter-spacing: 0.1px;
}

.display-5 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, system-ui, sans-serif;
    font-weight: 300;
    font-size: 3.5rem;
    letter-spacing: -1px;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    color: white !important;
}

/* Responsive heading sizes */
@media (max-width: 768px) {
    .display-5 {
        font-size: 2.5rem;
        letter-spacing: -0.5px;
    }
}

@media (max-width: 576px) {
    .display-5 {
        font-size: 2rem;
        letter-spacing: 0;
    }
}

/* Success Card Styling */
.card.border-success {
    border: 2px solid var(--success-color) !important;
}

.card.border-success .card-header {
    background: linear-gradient(45deg, var(--success-color), #2ecc71) !important;
}

/* Responsive Design */
@media (min-width: 1200px) {
    .container-fluid {
        max-width: 1400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1.5rem !important;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .display-5 {
        font-size: 1.75rem;
    }
    
    .input-group-lg .form-control {
        font-size: 1rem;
    }
    
    .btn-lg {
        font-size: 1rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .alert {
    animation: fadeIn 0.5s ease-out;
}

/* SVG Icon system */
.icon {
    color: var(--primary-color);
    fill: currentColor;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
}

/* Logo styling */
.logo-image {
    height: 50px;
    width: auto;
}

.alert .icon {
    color: inherit;
}

.bg-success .icon {
    color: white;
}

/* Custom hover effects */
.card-body:hover .input-group-text {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.card-body:hover .input-group-text .fas {
    color: white;
}

/* Form check styling */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Lookup Type Card Styling */
.lookup-option {
    position: relative;
}

.lookup-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 10;
}

.lookup-label {
    cursor: pointer;
    display: block;
    margin-bottom: 0;
}

.lookup-card {
    background: white;
    border: 2px solid #e9ecef !important;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.lookup-card:hover {
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.lookup-option input[type="radio"]:checked + .lookup-label .lookup-card {
    border-color: var(--primary-color) !important;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(52, 152, 219, 0.05));
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.lookup-option input[type="radio"]:checked + .lookup-label .lookup-card::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.lookup-card h6 {
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
    font-weight: 500;
    letter-spacing: -0.1px;
}

.lookup-card small {
    font-size: 0.85rem;
    line-height: 1.2;
}

/* Code styling */
code {
    background-color: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Results cards spacing */
.card:not(:last-child) {
    margin-bottom: 1.5rem;
}

/* Badge enhancements */
.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Port status specific styling */
.port-status {
    display: inline-block;
    margin-bottom: 0.5rem;
}

/* Disclaimer card specific styling */
.card.border-warning {
    border-width: 2px !important;
}

/* Responsive adjustments for results */
@media (max-width: 768px) {
    .col-sm-3 {
        margin-bottom: 0.25rem;
    }
    
    .results-section {
        padding: 1rem;
    }
    
    .badge {
        font-size: 0.8rem;
    }
    
    /* Mobile-specific lookup card styling */
    .lookup-card {
        min-height: 80px;
        display: flex;
        align-items: center;
    }
    
    .lookup-card .text-center {
        width: 100%;
    }
    
    .lookup-card i {
        font-size: 1.25rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .lookup-card h6 {
        font-size: 0.95rem;
        margin-bottom: 0.1rem !important;
    }
    
    .lookup-card small {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    /* Extra small devices - full width cards */
    .row.g-2 > .col-12 {
        margin-bottom: 0.5rem;
    }
    
    .lookup-card {
        min-height: 70px;
        padding: 0.75rem !important;
    }
    
    .lookup-card i {
        font-size: 1.1rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .lookup-card h6 {
        font-size: 0.9rem;
        margin-bottom: 0.1rem !important;
    }
    
    .lookup-card small {
        font-size: 0.7rem;
        line-height: 1.1;
    }
    
    /* Ensure proper spacing on mobile */
    .form-label.fw-semibold.mb-3 {
        margin-bottom: 1rem !important;
    }
}

/* Loading Button Styles */
#analyzeBtn:disabled {
    cursor: not-allowed;
    opacity: 1 !important;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

#analyzeBtn .icon.spin {
    animation: spin 1s linear infinite;
}

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

/* Button transition effects */
#analyzeBtn {
    transition: all 0.3s ease;
}

#analyzeBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

#analyzeBtn:disabled {
    transform: none;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
}

/* Center the loading text in button */
#btnLoading {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white !important;
    font-weight: 500;
}

/* Ensure loading text is always visible */
#analyzeBtn:disabled #btnLoading {
    color: white !important;
}
