/* Sanit Upload Plugin Styles */
:root {
    --sanit-primary: #2271b1;
    --sanit-primary-dark: #135e96;
    --sanit-success: #00a32a;
    --sanit-error: #d63638;
    --sanit-warning: #dba617;
    --sanit-border: #c3c4c7;
    --sanit-background: #f6f7f7;
    --sanit-text: #1d2327;
    --sanit-text-light: #646970;
    --sanit-radius: 4px;
    --sanit-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

/* Main Container */
.sanit-upload-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

.sanit-upload-form-wrapper {
    background: white;
    border: 1px solid var(--sanit-border);
    border-radius: var(--sanit-radius);
    padding: 30px;
    box-shadow: var(--sanit-shadow);
}

.sanit-upload-form-wrapper h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: var(--sanit-text);
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--sanit-text);
}

.form-group .required {
    color: var(--sanit-error);
}

/* File Input Styling */
.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.file-input-display {
    display: flex;
    align-items: center;
    min-height: 48px;
    border: 2px dashed var(--sanit-border);
    border-radius: var(--sanit-radius);
    padding: 12px 16px;
    background: var(--sanit-background);
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-input-display:hover {
    border-color: var(--sanit-primary);
    background: #f0f6fc;
}

.file-input-wrapper.has-file .file-input-display {
    border-color: var(--sanit-success);
    background: #f0f9f0;
}

.file-placeholder {
    flex: 1;
    color: var(--sanit-text-light);
    font-style: italic;
}

.file-browse-btn {
    background: var(--sanit-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--sanit-radius);
    font-weight: 500;
    cursor: pointer;
    pointer-events: none;
    transition: background 0.2s ease;
}

.file-input-display:hover .file-browse-btn {
    background: var(--sanit-primary-dark);
}

/* Email Input */
.email-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--sanit-border);
    border-radius: var(--sanit-radius);
    overflow: hidden;
}

.email-input-wrapper input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 16px;
    outline: none;
}

.email-domain {
    background: var(--sanit-background);
    padding: 12px 16px;
    color: var(--sanit-text-light);
    font-weight: 500;
    border-left: 1px solid var(--sanit-border);
    white-space: nowrap;
}

.email-input-wrapper:focus-within {
    border-color: var(--sanit-primary);
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

/* Standard Inputs */
.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--sanit-border);
    border-radius: var(--sanit-radius);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--sanit-primary);
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

.form-group select {
    cursor: pointer;
    background: white url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23646970" d="M6 8L2 4h8z"/></svg>') no-repeat right 12px center;
    appearance: none;
    padding-right: 40px;
}

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

/* Checkbox Styling */
.checkbox-group {
    margin-bottom: 30px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
    font-weight: 400;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    position: relative;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--sanit-border);
    border-radius: 3px;
    background: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 0;
    display: inline-block;
}

.checkbox-label:hover .checkmark {
    border-color: var(--sanit-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--sanit-primary);
    border-color: var(--sanit-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.privacy-link {
    background: none;
    border: none;
    color: var(--sanit-primary);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.privacy-link:hover {
    color: var(--sanit-primary-dark);
}

.checkbox-text {
    display: inline;
    line-height: 1.4;
}

/* Upload Button */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

.upload-btn {
    background: var(--sanit-primary);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--sanit-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 160px;
    position: relative;
}

.upload-btn:hover {
    background: var(--sanit-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.upload-btn:disabled {
    background: var(--sanit-border);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.upload-message {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--sanit-radius);
    text-align: center;
    font-weight: 500;
}

.upload-message.success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.upload-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c2c7;
}

/* Help Text */
.help-text {
    display: block;
    margin-top: 6px;
    color: var(--sanit-text-light);
    font-size: 14px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.2s ease forwards;
    margin-top: 50px;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80%;
    overflow: hidden;
    transform: scale(0.9);
    animation: modalScale 0.2s ease forwards;
}

@keyframes modalScale {
    to { transform: scale(1); }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--sanit-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h4 {
    margin: 0;
    color: var(--sanit-text);
    flex: 1;
}

.modal-header .modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--sanit-text-light);
    cursor: pointer;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
    font-weight: normal;
}

.modal-header .modal-close:hover {
    background: var(--sanit-background);
}

.modal-body {
    padding: 25px;
    max-height: 400px;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--sanit-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-primary {
    background: var(--sanit-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--sanit-radius);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: var(--sanit-primary-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--sanit-text);
    border: 1px solid var(--sanit-border);
    padding: 10px 20px;
    border-radius: var(--sanit-radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--sanit-background);
}

/* Privacy Policy Content */
.privacy-content h5 {
    color: var(--sanit-text);
    margin: 20px 0 10px 0;
    font-size: 16px;
}

.privacy-content h5:first-child {
    margin-top: 0;
}

.privacy-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.privacy-content li {
    margin-bottom: 5px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sanit-upload-container {
        padding: 10px;
    }
    
    .sanit-upload-form-wrapper {
        padding: 20px;
    }
    
    .sanit-upload-form-wrapper h3 {
        font-size: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .upload-btn {
        width: 100%;
        padding: 14px 20px;
    }
    
    .email-input-wrapper {
        flex-direction: column;
    }
    
    .email-domain {
        border-left: none;
        border-top: 1px solid var(--sanit-border);
        text-align: center;
    }
    
    .modal-content {
        margin: 20px;
        max-height: calc(100% - 40px);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .file-input-display {
        flex-direction: column;
        gap: 10px;
        padding: 16px;
    }
    
    .file-browse-btn {
        align-self: stretch;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .sanit-upload-form-wrapper {
        padding: 15px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .checkbox-label {
        font-size: 14px;
    }
    
    .modal-body {
        max-height: 300px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --sanit-border: #000;
        --sanit-text-light: #333;
    }
    
    .file-input-display {
        border-width: 2px;
        border-style: solid;
    }
}