/* css/cd2_styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.cd2-container {
    max-width: 900px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.cd2-header {
    padding: 24px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cd2-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.cd2-loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: cd2-spin 1s ease-in-out infinite;
}

@keyframes cd2-spin {
    to { transform: rotate(360deg); }
}

.cd2-content {
    padding: 32px;
}

.cd2-upload-container {
    background: white;
}

.cd2-upload-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.cd2-upload-header h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 8px;
}

.cd2-company-info {
    display: flex;
    gap: 20px;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
}

.cd2-company-info span {
    background: #f5f5ff;
    padding: 4px 12px;
    border-radius: 20px;
}

.cd2-upload-form {
    margin-bottom: 32px;
}

.cd2-file-input-area {
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cd2-file-input-area:hover,
.cd2-file-input-area.cd2-dragover {
    border-color: #667eea;
    background: #f5f5ff;
}

.cd2-upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.cd2-browse {
    color: #667eea;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.cd2-file-limits {
    margin-top: 12px;
    font-size: 12px;
    color: #888;
}

.cd2-file-list {
    margin: 16px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.cd2-file-preview {
    display: flex;
    align-items: center;
    padding: 8px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #eaeaea;
}

.cd2-file-preview:last-child {
    margin-bottom: 0;
}

.cd2-preview-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    margin-left: 8px;
}

.cd2-preview-size {
    font-size: 12px;
    color: #888;
    margin: 0 12px;
}

.cd2-preview-remove {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
}

.cd2-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cd2-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.cd2-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.cd2-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cd2-btn-secondary {
    background: #eaeaea;
    color: #666;
}

.cd2-btn-secondary:hover {
    background: #e0e0e0;
}

.cd2-btn-danger {
    background: #ff6b6b;
    color: white;
}

.cd2-btn-danger:hover {
    background: #ff5252;
}

.cd2-files-section {
    margin-top: 32px;
}

.cd2-files-section h4 {
    color: #333;
    margin-bottom: 16px;
    font-size: 16px;
}

.cd2-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.cd2-file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid #eaeaea;
}

.cd2-file-item:hover {
    background: white;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.cd2-file-icon {
    font-size: 24px;
    margin-right: 12px;
}

.cd2-file-info {
    flex: 1;
    min-width: 0;
}

.cd2-file-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.cd2-file-meta {
    font-size: 11px;
    color: #888;
}

.cd2-file-size {
    margin-left: 4px;
}

.cd2-delete-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.cd2-delete-btn:hover {
    color: #ff6b6b;
    background: #fff0f0;
}

.cd2-error {
    color: #ff6b6b;
    padding: 20px;
    text-align: center;
    background: #fff0f0;
    border-radius: 8px;
}

.cd2-warning {
    color: #f39c12;
    padding: 16px;
    text-align: center;
    background: #fff3e0;
    border-radius: 8px;
    margin-bottom: 24px;
}

.cd2-success {
    color: #27ae60;
    padding: 12px;
    background: #e8f5e9;
    border-radius: 8px;
    margin-bottom: 16px;
}

.cd2-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.cd2-modal.show {
    display: flex;
}

.cd2-modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cd2-modal-title {
    color: #333;
    margin-bottom: 12px;
    font-size: 18px;
}

.cd2-modal-message {
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

.cd2-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Анимации */
@keyframes cd2-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cd2-file-item {
    animation: cd2-fadeIn 0.3s ease;
}


/* Добавьте в конец файла css/cd2_styles.css */

.cd2-file-info {
    flex: 1;
    min-width: 0;
}

.cd2-file-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

.cd2-file-link:hover {
    color: #667eea;
}

.cd2-file-link:hover .cd2-file-name {
    color: #667eea;
    text-decoration: underline;
}

.cd2-file-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.cd2-file-meta {
    font-size: 11px;
    color: #888;
}

/* Стили для разных типов файлов */
.cd2-file-item[data-file-type="image"] .cd2-file-link:hover .cd2-file-name {
    color: #e67e22;
}

.cd2-file-item[data-file-type="pdf"] .cd2-file-link:hover .cd2-file-name {
    color: #e74c3c;
}

.cd2-file-item[data-file-type="video"] .cd2-file-link:hover .cd2-file-name {
    color: #3498db;
}

/* Анимация при наведении */
.cd2-file-item {
    transition: all 0.3s ease;
}

.cd2-file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}


/* Добавьте в конец файла */

.cd2-file-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    cursor: pointer;
}

.cd2-file-link:hover {
    color: #667eea;
}

.cd2-file-link:hover .cd2-file-name {
    color: #667eea;
    text-decoration: underline;
}

/* Индикатор типа открытия */
.cd2-file-item[data-file-type="jpg"] .cd2-file-link::after,
.cd2-file-item[data-file-type="jpeg"] .cd2-file-link::after,
.cd2-file-item[data-file-type="pdf"] .cd2-file-link::after,
.cd2-file-item[data-file-type="mp4"] .cd2-file-link::after {
    content: "↗";
    font-size: 12px;
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cd2-file-item[data-file-type="jpg"]:hover .cd2-file-link::after,
.cd2-file-item[data-file-type="jpeg"]:hover .cd2-file-link::after,
.cd2-file-item[data-file-type="pdf"]:hover .cd2-file-link::after,
.cd2-file-item[data-file-type="mp4"]:hover .cd2-file-link::after {
    opacity: 1;
}

/* Для скачиваемых файлов */
.cd2-file-item[data-file-type="doc"] .cd2-file-link::after,
.cd2-file-item[data-file-type="docx"] .cd2-file-link::after,
.cd2-file-item[data-file-type="xls"] .cd2-file-link::after,
.cd2-file-item[data-file-type="xlsx"] .cd2-file-link::after {
    content: "↓";
    font-size: 12px;
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cd2-file-item[data-file-type="doc"]:hover .cd2-file-link::after,
.cd2-file-item[data-file-type="docx"]:hover .cd2-file-link::after,
.cd2-file-item[data-file-type="xls"]:hover .cd2-file-link::after,
.cd2-file-item[data-file-type="xlsx"]:hover .cd2-file-link::after {
    opacity: 1;
}