/* Main Container */
.product-spec-download-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 20px 0;
    max-width: 100%;
}

/* Admin Notice */
.admin-notice {
    background-color: #FFF7E5;
    border-left: 4px solid #FFB900;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #826200;
    border-radius: 2px;
}

/* Admin Upload Section */
.admin-upload-section {
    background-color: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.admin-upload-section h4 {
    color: #0073aa;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.upload-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.file-input-container {
    flex: 1 1 250px;
    display: flex;
    flex-direction: column;
}

.doc-name-input-container {
    flex: 1 1 250px;
}

.doc-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.file-input-label {
    display: inline-block;
    background-color: #0073aa;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-align: center;
}

.file-input-label:hover {
    background-color: #005177;
}

.selected-file-name {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-name-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.upload-ftp-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #D40000; /* Rosso Corsa Red */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-ftp-button:hover {
    background-color: #FF0000;
}

.upload-icon {
    fill: white;
    margin-right: 6px;
    width: 18px;
    height: 18px;
}

.upload-status {
    margin-top: 15px;
    width: 100%;
}

.upload-success {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #d4edda;
    border-radius: 4px;
    color: #155724;
    margin-bottom: 10px;
}

.upload-success-icon {
    fill: #155724;
    margin-right: 10px;
}

.upload-success-secondary {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #e6f7ff;
    border-radius: 4px;
    color: #0070a3;
    margin-bottom: 10px;
}

.upload-success-secondary .upload-success-icon {
    fill: #0070a3;
    margin-right: 10px;
}

.error-details {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #721c24;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow: auto;
}

.upload-error {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f8d7da;
    border-radius: 4px;
    color: #721c24;
}

.upload-error-icon {
    fill: #721c24;
    margin-right: 10px;
}

.upload-details {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.full-width-input {
    width: 100%;
    margin-top: 5px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 2px;
    font-size: 0.85rem;
    color: #555;
    background-color: #f5f5f5;
    cursor: pointer;
}

/* Title */
.product-spec-download-title {
    color: #D40000; /* Rosso Corsa Red */
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.product-spec-download-title:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: #D40000; /* Rosso Corsa Red */
}

/* Loading State */
.product-spec-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #666;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.download-loading-icon {
    fill: #D40000; /* Rosso Corsa Red */
    margin-right: 10px;
}

/* Error State */
.product-spec-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #D40000; /* Rosso Corsa Red */
    background-color: #fff0f0;
    border-radius: 6px;
}

.download-error-icon {
    fill: #D40000; /* Rosso Corsa Red */
    margin-right: 10px;
}

/* Empty State */
.product-spec-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #666;
    background-color: #f9f9f9;
    border-radius: 6px;
}

/* Admin Empty State */
.admin-empty {
    background-color: #FFF7E5;
    color: #826200;
    border: 1px dashed #FFB900;
}

.download-empty-icon {
    fill: #999;
    margin-right: 10px;
}

/* Document List */
.product-spec-docs-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Document Item */
.product-spec-doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    background-color: #fff;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
}

.product-spec-doc-item:last-child {
    border-bottom: none;
}

.product-spec-doc-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.product-spec-doc-item:hover {
    background-color: #f9f9f9;
}

/* Document Info Section */
.doc-item-info {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
}

/* Document Icon */
.doc-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.doc-icon {
    width: 24px;
    height: 24px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Admin URL Info */
.admin-url-info {
    margin-top: 5px;
    font-size: 0.85rem;
    color: #666;
}

/* Document Types */
.file-type-pdf .doc-icon-wrapper {
    background-color: #F44336;
}

.file-type-doc .doc-icon-wrapper,
.file-type-docx .doc-icon-wrapper {
    background-color: #2196F3;
}

.file-type-xls .doc-icon-wrapper,
.file-type-xlsx .doc-icon-wrapper,
.file-type-csv .doc-icon-wrapper {
    background-color: #4CAF50;
}

.file-type-ppt .doc-icon-wrapper,
.file-type-pptx .doc-icon-wrapper {
    background-color: #FF9800;
}

.file-type-zip .doc-icon-wrapper,
.file-type-rar .doc-icon-wrapper {
    background-color: #795548;
}

.file-type-jpg .doc-icon-wrapper,
.file-type-jpeg .doc-icon-wrapper,
.file-type-png .doc-icon-wrapper,
.file-type-gif .doc-icon-wrapper,
.file-type-svg .doc-icon-wrapper {
    background-color: #9C27B0;
}

.file-type-mp4 .doc-icon-wrapper,
.file-type-avi .doc-icon-wrapper,
.file-type-mov .doc-icon-wrapper {
    background-color: #E91E63;
}

.file-type-mp3 .doc-icon-wrapper,
.file-type-wav .doc-icon-wrapper {
    background-color: #673AB7;
}

.file-type-txt .doc-icon-wrapper {
    background-color: #607D8B;
}

.file-type-dwg .doc-icon-wrapper {
    background-color: #00BCD4;
}

/* Document Icon Images */
.file-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z"/><path d="M14 3v5h5"/></svg>');
}

.pdf-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 16a1 1 0 0 1-.7-.29 1 1 0 0 1 0-1.42l1.3-1.29H8a1 1 0 0 1 0-2h4.59l-1.3-1.29a1 1 0 0 1 1.42-1.42l3 3a1 1 0 0 1 0 1.42l-3 3A1 1 0 0 1 12 16z"/><path d="M20 8.94a1.31 1.31 0 0 0-.06-.27v-.09a1.1 1.1 0 0 0-.19-.28h0l-6-6h0a1.1 1.1 0 0 0-.28-.19.09.09 0 0 0-.09 0 1.31 1.31 0 0 0-.28-.11H7a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V8.94zm-6-3.53L16.59 8H14V5.41zM18 19a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h5v5a1 1 0 0 0 1 1h5v9z"/></svg>');
}

.word-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z"/><path d="M14 3v5h5"/><path d="M9 12h6M9 16h6"/></svg>');
}

.excel-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z"/><path d="M14 3v5h5"/><path d="M8 13h2m4 0h2M8 17h2m4 0h2M8 9h8"/></svg>');
}

.powerpoint-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z"/><path d="M14 3v5h5"/><circle cx="9" cy="13" r="2"/><path d="M9 15v2m6-4a2 2 0 0 0-2-2h-2"/></svg>');
}

.archive-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M21 8v10a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V8M3 5h18v2H3z"/><path d="M9 14h6m-6-3h6"/></svg>');
}

.image-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="m21 15-5-5-8 8"/></svg>');
}

.video-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><rect x="2" y="4" width="20" height="16" rx="2" ry="2"/><path d="m10 8 5 4-5 4V8z"/></svg>');
}

.audio-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>');
}

.text-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z"/><path d="M14 3v5h5"/><path d="M8 13h8M8 17h8M8 9h4"/></svg>');
}

.cad-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2z"/><path d="M12 12v5m-3-2h6"/></svg>');
}

/* Document Details */
.doc-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.doc-name {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.file-size {
    color: #666;
    font-size: 0.85em;
    margin-top: 3px;
}

/* Download Button */
.download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #D40000; /* Rosso Corsa Red */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-left: 15px;
}

.download-button:hover {
    background-color: #FF0000;
    transform: translateY(-2px);
}

.download-button:active {
    transform: translateY(0);
}

.download-button.loading {
    background-color: #888;
    pointer-events: none;
}

.download-icon {
    fill: white;
    margin-right: 6px;
    width: 18px;
    height: 18px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .upload-form {
        flex-direction: column;
    }
    
    .file-input-container,
    .doc-name-input-container {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .upload-ftp-button {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .product-spec-doc-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .download-button {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        padding: 8px 12px;
    }
    
    .doc-item-info {
        width: 100%;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-spec-doc-item {
    animation: fadeInUp 0.5s ease forwards;
    animation-play-state: paused;
}

.product-spec-doc-item.visible {
    animation-play-state: running;
}