/* =========================
   FILE ANALYZER TOOL
========================= */

.file-analyzer .container {
    max-width: 900px;
    margin: 40px auto;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 63, 127, 0.2);
    border-radius: 16px;
    background: white;
}

.file-analyzer h1 {
    font-size: 2em;
    color: #003f7f;
    margin: 0 0 28px 0;
    text-align: center;
}

#file-analyzer-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* Contenitore scelta file */
.file-analyzer .upload-area {
    width: 100%;
    text-align: center;
    padding: 48px 40px;
    border: 2px dashed #b8d4f0;
    border-radius: 16px;
    background: linear-gradient(145deg, #f8fcff 0%, #e8f4fd 50%, #f0f7fc 100%);
    box-sizing: border-box;
    box-shadow: inset 0 2px 8px rgba(0, 123, 255, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.file-analyzer .upload-area:hover {
    border-color: #7eb8f0;
    box-shadow: inset 0 2px 12px rgba(0, 123, 255, 0.06);
}

.file-analyzer .file-input-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.file-analyzer .file-input-wrapper input[type="file"] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.file-analyzer .choose-file-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    background: var(--btn-primary, #003f7f);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.file-analyzer .choose-file-btn:hover {
    background: #dc3545;
    transform: scale(1.03);
}

.file-analyzer .upload-hint {
    margin: 16px 0 0 0;
    color: #666;
    font-size: 0.95rem;
}

.analysis-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fcff 0%, #eef6fc 100%);
    border-radius: 14px;
    border: 1px solid #d0e5f7;
    width: 100%;
    box-sizing: border-box;
}

.analysis-options-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #dc3545;
    flex-basis: 100%;
    text-align: center;
}

.analysis-options-row {
    display: flex;
    flex-wrap: nowrap;
    flex-basis: 100%;
    justify-content: space-between;
}

.analysis-options-row .analysis-option {
    flex-shrink: 0;
}

.analysis-option {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: #444;
    cursor: pointer;
    padding: 4px 8px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.analysis-option:hover {
    border-color: #7eb8f0;
    background: #f8fcff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.analysis-option input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.analysis-option .check-box {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1.5px solid #b8d4f0;
    background: white;
    transition: all 0.2s ease;
    position: relative;
}

.analysis-option input:checked + .check-box {
    background: #003f7f;
    border-color: #007BFF;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.35);
}

.analysis-option input:checked + .check-box::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 7px;
    border: solid white;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.analysis-option:has(input:checked) {
    color: #003f7f;
}

/* Analyze button */
#submit-file {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    background: #003f7f;
    color: white;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

#submit-file:hover {
    background: #0056b3;
    transform: scale(1.05);
}

/* Results area */
#file-results {
    margin-top: 28px;
    min-height: 60px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

#file-results.show {
    opacity: 1;
    visibility: visible;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.result-card {
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-card-wide {
    grid-column: 1 / -1;
}

.result-label {
    font-size: 0.85em;
    color: #64748b;
    font-weight: 600;
}

.result-value {
    font-size: 1.1em;
    font-weight: 600;
    color: #003f7f;
}

.result-hash {
    font-family: monospace;
    font-size: 0.9em;
    word-break: break-all;
}

.loading-msg {
    color: #64748b;
    text-align: center;
    margin: 0;
}

#file-results .error-msg {
    display: block;
    width: 100%;
    color: #dc3545;
    text-align: center;
    font-weight: bold;
    margin: 0;
    padding: 16px;
}

@media (max-width: 768px) {
    .file-analyzer .container {
        margin: 20px 16px;
        padding: 28px 24px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .file-analyzer .container {
        margin: 12px 10px;
        padding: 24px 18px;
    }
    .file-analyzer h1 {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .file-analyzer .container {
        margin: 8px 8px;
        padding: 20px 14px;
    }
}
