/**
 * Frontend styles for Client File Transfer
 * Brand colors: Dark Gray #333333, Yellow #ffce24
 */

.cft-file-transfer-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.cft-section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a1a1a;
    border-bottom: 3px solid #ffce24;
    padding-bottom: 10px;
}

.cft-upload-section,
.cft-download-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cft-upload-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cft-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cft-form-group label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.cft-input,
.cft-textarea {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.cft-input:focus,
.cft-textarea:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
}

.cft-textarea {
    resize: vertical;
    min-height: 80px;
}

.cft-file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    border: 2px dashed #333;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.cft-file-label:hover {
    background: #fff9e6;
    border-color: #ffce24;
}

.cft-file-label.cft-drag-over,
.cft-upload-section.cft-drag-over .cft-file-label {
    background: #fff9e6;
    border-color: #ffce24;
    border-style: solid;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 206, 36, 0.3);
}

.cft-upload-section.cft-drag-over {
    background: #fffdf5;
}

.cft-file-label.cft-drag-over .cft-file-label-text {
    color: #333;
    font-weight: 600;
}

.cft-file-label.cft-drag-over .cft-file-label-icon {
    transform: scale(1.2);
}

.cft-file-label-text {
    font-weight: 500;
    color: #333;
    font-size: 16px;
}

.cft-file-label-icon {
    font-size: 24px;
}

.cft-file-input {
    display: none;
}

.cft-file-info {
    margin-top: 10px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    display: none;
}

.cft-file-info.active {
    display: block;
}

.cft-files-preview {
    margin-top: 15px;
    display: none;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    background: #f8f9fa;
}

.cft-files-preview.active {
    display: block;
}

.cft-selected-file {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    font-size: 13px;
}

.cft-selected-file:last-child {
    margin-bottom: 0;
}

.cft-selected-file .cft-file-name {
    flex: 1;
    color: #333;
    word-break: break-word;
    margin-right: 10px;
}

.cft-selected-file .cft-file-size {
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.cft-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.cft-btn-primary {
    background: #333;
    color: white;
}

.cft-btn-primary:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cft-btn-primary:active {
    transform: translateY(0);
}

.cft-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cft-btn-download {
    background: #333;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.cft-btn-download:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cft-btn-loader {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cft-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 10px;
    display: none;
    font-size: 14px;
}

.cft-message.success {
    background: #fff9e6;
    color: #333;
    border: 2px solid #ffce24;
    display: block;
}

.cft-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.cft-files-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cft-file-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.cft-file-item:hover {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.cft-file-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.cft-file-details {
    flex: 1;
    min-width: 0;
}

.cft-file-name {
    font-weight: 600;
    font-size: 16px;
    color: #1a1a1a;
    margin-bottom: 6px;
    word-break: break-word;
}

.cft-file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.cft-file-description {
    font-size: 14px;
    color: #555;
    margin-top: 8px;
    font-style: italic;
}

.cft-no-files {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

/* Upload Progress Styles */
.cft-upload-progress {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.cft-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cft-progress-status {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.cft-progress-count {
    font-size: 13px;
    color: #333;
    background: #ffce24;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.cft-progress-current-file {
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
    word-break: break-word;
    padding: 8px 12px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.cft-progress-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.cft-progress-bar {
    flex: 1;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.cft-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffce24, #ffd84d);
    border-radius: 6px;
    transition: width 0.2s ease-out;
}

.cft-progress-percent {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    min-width: 45px;
    text-align: right;
}

.cft-progress-details {
    font-size: 12px;
    color: #888;
}

.cft-upload-progress.uploading .cft-progress-bar-fill {
    animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.cft-upload-progress.complete .cft-progress-bar-fill {
    background: linear-gradient(90deg, #4CAF50, #4CAF50);
}

.cft-upload-progress.error .cft-progress-bar-fill {
    background: linear-gradient(90deg, #f44336, #ef5350);
}

/* Per-file status in files preview during upload */
.cft-selected-file.uploading {
    border-color: #ffce24;
    background: #fff9e6;
}

.cft-selected-file.complete {
    border-color: #4CAF50;
    background: #E8F5E9;
}

.cft-selected-file.error {
    border-color: #f44336;
    background: #FFEBEE;
}

.cft-selected-file .cft-upload-status {
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
}

.cft-selected-file.uploading .cft-upload-status {
    color: #333;
}

.cft-selected-file.complete .cft-upload-status {
    color: #4CAF50;
}

.cft-selected-file.error .cft-upload-status {
    color: #f44336;
}

/* Session Uploads Section */
.cft-session-uploads {
    margin-top: 30px;
    padding: 25px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.cft-session-uploads .cft-section-title {
    color: #333;
    border-bottom-color: #ffce24;
}

.cft-session-files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cft-session-file-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff9e6;
    border-radius: 8px;
    border: 1px solid #ffce24;
}

.cft-session-file-icon {
    color: #333;
    font-size: 18px;
    margin-right: 12px;
    font-weight: bold;
}

.cft-session-file-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    word-break: break-word;
}

.cft-session-file-time {
    font-size: 12px;
    color: #666;
    margin-left: 15px;
    white-space: nowrap;
}

/* Responsive design */
@media (max-width: 768px) {
    .cft-file-transfer-container {
        padding: 20px 15px;
    }
    
    .cft-upload-section,
    .cft-download-section {
        padding: 20px;
    }
    
    .cft-file-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cft-file-item .cft-btn-download {
        width: 100%;
    }
    
    .cft-file-meta {
        flex-direction: column;
        gap: 5px;
    }
}
