/* Enhanced Color Scheme & Advanced UI Styles */

/* Basic Reset and Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa; /* Very light, clean background */
    color: #343a40; /* Dark charcoal text */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden; 
}

/* Header and Footer */
header {
    background-color: #007bff; /* Primary Brand Blue */
    color: white;
    padding: 30px 15px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

footer {
    width: 100%;
    background-color: #343a40; /* Dark Footer */
    color: #ced4da;
    text-align: center;
    padding: 18px 15px;
    margin-top: auto;
    font-size: 0.9em;
    flex-shrink: 0;
}

footer a {
    color: #17a2b8;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

footer a:hover {
    color: #007bff;
}

main {
    width: 90%;
    max-width: 1100px;
    margin: 30px 0;
    flex-grow: 1;
    padding: 0 10px;
}

/* Input Section */
.input-section {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: nowrap; 
}

#targetUrl {
    flex-grow: 1;
    padding: 14px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1.1em;
    transition: border-color 0.3s;
    min-width: 0; 
}

#targetUrl:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    outline: none;
}

button {
    padding: 14px 30px;
    background-color: #28a745; 
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    transition: background-color 0.3s, transform 0.1s;
    flex-shrink: 0;
}

button:hover {
    background-color: #1e7e34;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
}

button:disabled {
    background-color: #90ee90;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Status Section */
.status-section {
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.status-info { color: #007bff; font-weight: bold; }
.status-error { color: #dc3545; font-weight: bold; }
.status-scanning { color: #ffc107; font-weight: bold; }

/* Results and Summary */
.results-section {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.results-section h2 {
    color: #007bff;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    margin-top: 0;
}

.results-summary {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    margin-bottom: 25px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap; 
}

.summary-item {
    font-size: 1.1em;
    font-weight: bold;
    padding: 5px 10px;
    margin: 5px; 
}

.download-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: flex-end;
    flex-wrap: wrap; 
}

.download-buttons button {
    background-color: #17a2b8;
    color: white;
    font-weight: 500;
}

.download-buttons button:hover {
    background-color: #138496;
}

.result-item {
    padding: 20px;
    margin-bottom: 18px;
    border-left: 6px solid;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s;
    word-wrap: break-word; 
    overflow-wrap: break-word;
}

.result-item:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.result-item h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.result-item strong {
    color: #343a40;
}

.result-item a {
    color: #007bff;
    text-decoration: none;
}

.result-item a:hover {
    text-decoration: underline;
}

/* Severity Styling */
.severity-Critical { border-left-color: #dc3545; color: #dc3545; } 
.severity-High { border-left-color: #ffc107; color: #ffc107; }
.severity-Medium { border-left-color: #ffc107; color: #ffc107; } 
.severity-Low { border-left-color: #17a2b8; color: #17a2b8; } 
.severity-Info { border-left-color: #28aa45; color: #28a745; } 

/* --- MODAL AND SPINNER STYLES --- */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #ffffff;
    margin: 15% auto;
    padding: 40px;
    border-radius: 15px;
    width: 80%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.spinner {
    border: 8px solid #e9ecef;
    border-top: 8px solid #007bff;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

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

.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 10px;
    margin: 20px 0;
    height: 18px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: #28a745;
    transition: width 0.5s ease-in-out;
    border-radius: 10px;
}

.hidden {
    display: none !important;
}

/* --- MEDIA QUERIES FOR MOBILE LAYOUT --- */
@media (max-width: 768px) {
    
    main {
        width: 100%;
        padding: 0 15px;
        margin-top: 20px;
    }

    header h1 {
        font-size: 1.5em;
    }

    header p {
        font-size: 0.9em;
    }

    .input-section {
        flex-direction: column; 
        padding: 20px;
        gap: 10px;
    }

    #targetUrl {
        padding: 12px;
        font-size: 1em;
    }

    button {
        width: 100%; 
        padding: 12px;
        font-size: 1em;
    }

    .results-section {
        padding: 20px;
    }

    .results-summary {
        flex-direction: column; 
        align-items: flex-start;
        padding: 10px;
    }

    .summary-item {
        margin: 5px 0;
        padding: 5px 0;
        border-bottom: 1px dashed #e9ecef;
        width: 100%;
    }

    .download-buttons {
        flex-direction: column; 
        gap: 10px;
        margin-bottom: 15px;
    }

    .download-buttons button {
        width: 100%;
    }

    footer p {
        padding: 0;
    }
}