/**
 * File Upload Notifier - Styles
 * Version: 2.3.0 - Individual Progress Bars Per File
 */

/* =====================
   CONTAINER
   ===================== */

.fun-upload-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 25px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.fun-upload-container * {
    box-sizing: border-box;
}

.fun-upload-container h3 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
}

/* =====================
   USER INFO
   ===================== */

.fun-user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 20px;
    background: #f5f5f5;
    border-radius: 4px;
}

.fun-user-info p {
    margin: 0;
}

.fun-logout-btn {
    padding: 5px 12px;
    font-size: 12px;
    color: #666;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
}

.fun-logout-btn:hover {
    color: #c00;
    border-color: #c00;
}

/* =====================
   FORMS
   ===================== */

.fun-form-group {
    margin-bottom: 18px;
}

.fun-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.fun-form-group input[type="text"],
.fun-form-group input[type="password"],
.fun-form-group textarea {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.fun-form-group input:focus,
.fun-form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

.fun-form-group textarea {
    min-height: 70px;
    resize: vertical;
}

.fun-submit-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: #0073aa;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.fun-submit-btn:hover {
    background: #005a87;
}

.fun-submit-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

.fun-help-text {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

/* =====================
   DROP ZONE
   ===================== */

.fun-drop-zone {
    position: relative;
    min-height: 150px;
    padding: 30px 20px;
    text-align: center;
    background: #fafafa;
    border: 2px dashed #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fun-drop-zone:hover {
    background: #f0f7fc;
    border-color: #0073aa;
}

.fun-drop-zone.fun-drop-zone-dragover {
    background: #e6f3ff;
    border-color: #0073aa;
    border-style: solid;
}

.fun-drop-zone-content {
    pointer-events: none;
}

.fun-drop-zone-content svg {
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: #999;
}

.fun-drop-zone-text {
    margin: 0 0 5px;
    font-size: 14px;
    color: #333;
}

.fun-drop-zone-hint {
    margin: 0;
    font-size: 12px;
    color: #888;
}

.fun-drop-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* =====================
   FILE LIST
   ===================== */

.fun-files-selected {
    margin-top: 15px;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.fun-files-header {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.fun-files-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* =====================
   FILE ROW - WITH PROGRESS
   ===================== */

.fun-file-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.fun-file-row:last-child {
    margin-bottom: 0;
}

/* Status colors */
.fun-file-row.fun-file-pending {
    background: #f9f9f9;
    border-color: #ddd;
}

.fun-file-row.fun-file-invalid {
    background: #fff5f5;
    border-color: #fcc;
}

.fun-file-row.fun-file-uploading {
    background: #f0f7ff;
    border-color: #b3d7ff;
}

.fun-file-row.fun-file-success {
    background: #f0fff4;
    border-color: #b3e6c0;
}

.fun-file-row.fun-file-error {
    background: #fff5f5;
    border-color: #f5c6cb;
}

/* File icon */
.fun-file-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    background: #999;
    border-radius: 50%;
}

.fun-file-pending .fun-file-icon {
    background: #0073aa;
    color: #fff;
}

.fun-file-invalid .fun-file-icon {
    background: #dc3232;
}

.fun-file-uploading .fun-file-icon {
    background: #0073aa;
    animation: pulse 1s infinite;
}

.fun-file-success .fun-file-icon {
    background: #46b450;
}

.fun-file-error .fun-file-icon {
    background: #dc3232;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* File info container */
.fun-file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fun-file-name {
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fun-file-size {
    font-size: 11px;
    color: #888;
}

.fun-file-err {
    font-size: 11px;
    color: #c00;
}

.fun-file-msg-ok {
    font-size: 11px;
    color: #2e7d32;
    font-weight: 500;
}

.fun-file-msg-err {
    font-size: 11px;
    color: #c00;
}

/* =====================
   INDIVIDUAL PROGRESS BAR
   ===================== */

.fun-file-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.fun-file-progress-track {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.fun-file-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    border-radius: 4px;
    transition: width 0.2s ease;
}

.fun-file-progress-text {
    flex-shrink: 0;
    min-width: 36px;
    font-size: 11px;
    font-weight: 600;
    color: #0073aa;
    text-align: right;
}

/* Delete button */
.fun-file-del {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 18px;
    line-height: 22px;
    color: #999;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fun-file-del:hover {
    color: #c00;
    background: #fee;
}

/* =====================
   OVERALL PROGRESS (hidden now, but kept for compatibility)
   ===================== */

#fun-upload-progress {
    display: none !important;
}

/* =====================
   MESSAGES
   ===================== */

#fun-login-message,
#fun-upload-message {
    margin-top: 15px;
}

.fun-msg {
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
}

.fun-msg-success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.fun-msg-error {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.fun-msg-warning {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffeeba;
}

/* =====================
   RESPONSIVE
   ===================== */

@media (max-width: 500px) {
    .fun-upload-container {
        margin: 10px;
        padding: 15px;
    }

    .fun-user-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .fun-drop-zone {
        min-height: 120px;
        padding: 20px 15px;
    }

    .fun-file-row {
        padding: 10px;
    }

    .fun-file-name {
        font-size: 12px;
    }

    .fun-submit-btn {
        width: 100%;
    }
}
