/* Enhanced Admin Form Styles */

/* Form Container Enhancements */
.form-container {
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.9) 0%, rgba(45, 55, 72, 0.9) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.form-container:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* Enhanced Form Input Styles */
.form-input {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9) 0%, rgba(17, 24, 39, 0.9) 100%);
    border: 2px solid rgba(75, 85, 99, 0.5);
    color: #f9fafb;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-input:focus {
    border-color: #6366f1;
    box-shadow: 
        0 0 0 4px rgba(99, 102, 241, 0.1),
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(99, 102, 241, 0.15);
    outline: none;
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(31, 41, 55, 1) 0%, rgba(17, 24, 39, 1) 100%);
    color: #ffffff;
}

.form-input:hover:not(:focus) {
    border-color: rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(17, 24, 39, 0.95) 100%);
}

.form-input::placeholder {
    color: #9ca3af;
    opacity: 0.7;
    font-style: italic;
}

/* Enhanced Labels */
.form-label {
    color: #e5e7eb;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease;
}

.form-label:hover {
    color: #f3f4f6;
}

.form-label .required {
    color: #ef4444;
    font-weight: 700;
}

.form-label .help-icon {
    color: #9ca3af;
    cursor: help;
    transition: color 0.3s ease;
}

.form-label .help-icon:hover {
    color: #6366f1;
}

/* Input Groups with Icons */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group .form-input {
    padding-left: 48px;
}

.input-group .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    z-index: 10;
    transition: color 0.3s ease;
    pointer-events: none;
}

.input-group .form-input:focus + .input-icon,
.input-group:hover .input-icon {
    color: #6366f1;
}

/* Enhanced Select Dropdowns */
.form-select {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9) 0%, rgba(17, 24, 39, 0.9) 100%);
    border: 2px solid rgba(75, 85, 99, 0.5);
    color: #f9fafb;
    border-radius: 12px;
    padding: 12px 40px 12px 16px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-select:focus {
    border-color: #6366f1;
    box-shadow: 
        0 0 0 4px rgba(99, 102, 241, 0.1),
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(99, 102, 241, 0.15);
    outline: none;
    transform: translateY(-1px);
}

.form-select:hover:not(:focus) {
    border-color: rgba(99, 102, 241, 0.4);
}

/* Enhanced Textarea */
.form-textarea {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9) 0%, rgba(17, 24, 39, 0.9) 100%);
    border: 2px solid rgba(75, 85, 99, 0.5);
    color: #f9fafb;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    resize: vertical;
    min-height: 100px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    line-height: 1.6;
}

.form-textarea:focus {
    border-color: #6366f1;
    box-shadow: 
        0 0 0 4px rgba(99, 102, 241, 0.1),
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(99, 102, 241, 0.15);
    outline: none;
    transform: translateY(-1px);
}

/* Enhanced Checkboxes and Radio Buttons */
.form-checkbox,
.form-radio {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9) 0%, rgba(17, 24, 39, 0.9) 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    margin: 0;
    appearance: none;
}

.form-radio {
    border-radius: 50%;
}

.form-checkbox:checked,
.form-radio:checked {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.form-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 5px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-radio:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.form-checkbox:focus,
.form-radio:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Enhanced File Upload */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9) 0%, rgba(17, 24, 39, 0.9) 100%);
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    padding: 32px 16px;
    backdrop-filter: blur(10px);
}

.file-input-wrapper:hover {
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(17, 24, 39, 0.95) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.file-input-wrapper.dragover {
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(79, 70, 229, 0.1) 100%);
    transform: scale(1.02);
}

.file-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.file-upload-icon {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 16px;
    display: block;
    transition: all 0.3s ease;
}

.file-input-wrapper:hover .file-upload-icon {
    color: #6366f1;
    transform: scale(1.1);
}

.file-upload-text {
    color: #e5e7eb;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.file-upload-hint {
    color: #9ca3af;
    font-size: 14px;
}

/* Image Preview Enhancements */
.image-preview {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.image-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* Enhanced Buttons */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #5b5af1 0%, #4338ca 100%);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(75, 85, 99, 0.9) 0%, rgba(55, 65, 81, 0.9) 100%);
    color: #e5e7eb;
    border: 1px solid rgba(107, 114, 128, 0.5);
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.9) 0%, rgba(75, 85, 99, 0.9) 100%);
    color: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

/* Form Validation Styles */
.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-input.success,
.form-select.success,
.form-textarea.success {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

.success-message {
    color: #10b981;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.success-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Tag Input Enhancement */
.tag-container {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9) 0%, rgba(17, 24, 39, 0.9) 100%);
    border: 2px solid rgba(75, 85, 99, 0.5);
    border-radius: 12px;
    padding: 12px;
    min-height: 50px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    transition: all 0.3s ease;
}

.tag-container:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.tag-badge {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(79, 70, 229, 0.2) 100%);
    color: #c7d2fe;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    animation: tagSlideIn 0.3s ease;
}

@keyframes tagSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.tag-badge:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(79, 70, 229, 0.3) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.tag-remove {
    cursor: pointer;
    color: #ef4444;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 0 2px;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-remove:hover {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.2);
}

/* Form Groups and Layouts */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.form-section {
    background: rgba(31, 41, 55, 0.3);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.form-section-title {
    color: #f3f4f6;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-title i {
    color: #6366f1;
}

/* Loading States */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading .spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-container {
        margin: 16px;
        padding: 24px 16px;
    }
    
    .file-input-wrapper {
        padding: 24px 12px;
    }
    
    .file-upload-icon {
        font-size: 36px;
    }
}

/* Focus Management */
.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form-checkbox:focus,
.form-radio:focus {
    z-index: 10;
    position: relative;
}

/* Accessibility Enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: rgba(17, 24, 39, 0.95);
    color: #f9fafb;
    text-align: center;
    border-radius: 8px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(17, 24, 39, 0.95) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Additional Text Styles for Light Text on Dark Backgrounds */
.help-text, .field-hint, .form-help, .form-description {
    color: #d1d5db;
    font-size: 12px;
    margin-top: 4px;
    font-style: italic;
    line-height: 1.4;
    opacity: 0.9;
}

.field-hint {
    color: #9ca3af;
    font-size: 11px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.8;
}

.form-label.required::after {
    content: '*';
    color: #ef4444;
    margin-left: 4px;
    font-weight: 700;
}

/* Ensure all text elements use light colors */
.form-container p, 
.form-container span, 
.form-container label:not(.form-label),
.form-container div:not(.form-input):not(.file-input-wrapper) {
    color: #e5e7eb;
}

.form-container small {
    color: #9ca3af;
}
