/* HNBGU Frontend Upload Form Styles */

.hnbgu-upload-form, .hnbgu-login-form {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
}

.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.upload-header h2 {
    margin: 0;
    color: #5D38DE;
    font-size: 24px;
    font-weight: bold;
}

.user-info {
    font-size: 14px;
    color: #666;
}

.logout-btn {
    color: #5D38DE;
    text-decoration: none;
    margin-left: 10px;
    padding: 5px 12px;
    border: 1px solid #5D38DE;
    border-radius: 4px;
    transition: 0.2s;
}

.logout-btn:hover {
    background: #5D38DE;
    color: white;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.form-row input[type="text"],
.form-row input[type="file"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: 0.2s;
    box-sizing: border-box;
}

.form-row input[type="text"]:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: #5D38DE;
    outline: none;
    box-shadow: 0 0 0 3px rgba(93, 56, 222, 0.1);
}

.form-row input[type="file"] {
    padding: 10px;
    background: #f8f9fa;
    cursor: pointer;
}

/* Helper text styling */
.form-row small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    padding: 5px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #5D38DE;
}

.add-new {
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #ccc;
}

.add-new input[type="text"] {
    margin-bottom: 10px;
}

.add-new input[type="text"]:last-child {
    margin-bottom: 10px;
}

.add-new select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.add-new select:focus {
    border-color: #5D38DE;
    outline: none;
}

.add-term-btn {
    background: #5D38DE !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: 0.2s !important;
    margin-top: 5px !important;
    display: inline-block !important;
    min-width: 80px !important;
    text-align: center !important;
}

.add-term-btn:hover {
    background: #4c2db8;
}

.add-term-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.add-term-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.add-term-success {
    background: #28a745;
    animation: successFlash 0.5s ease;
}

@keyframes successFlash {
    0% { background: #28a745; }
    50% { background: #20c997; }
    100% { background: #28a745; }
}

#image-preview {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.image-preview-item {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
}

.image-preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.image-preview-item .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4444;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-item .image-name {
    padding: 8px;
    font-size: 12px;
    color: #666;
    background: white;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: #5D38DE;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
}

.submit-btn:hover {
    background: #4c2db8;
    transform: translateY(-2px);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: inline-block;
}

.upload-success {
    background: #d4edda;
    color: #155724;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
    font-size: 13px;
    line-height: 1.4;
}

.upload-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
    font-size: 13px;
    line-height: 1.4;
}

/* Login Form Styles */
.hnbgu-login-form h2 {
    color: #5D38DE;
    margin-bottom: 15px;
    text-align: center;
}

.hnbgu-login-form p {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
}

#hnbgu-loginform {
    max-width: 300px;
    margin: 0 auto;
}

#hnbgu-loginform p {
    margin-bottom: 15px;
}

#hnbgu-loginform label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

#hnbgu-loginform input[type="text"],
#hnbgu-loginform input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    box-sizing: border-box;
}

#hnbgu-loginform input[type="submit"] {
    width: 100%;
    padding: 12px;
    background: #5D38DE;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

#hnbgu-loginform input[type="submit"]:hover {
    background: #4c2db8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hnbgu-upload-form, .hnbgu-login-form {
        margin: 15px;
        padding: 20px;
    }
    
    .upload-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .upload-header h2 {
        font-size: 20px;
    }
    
    #image-preview {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .image-preview-item img {
        height: 100px;
    }
}

@media (max-width: 480px) {
    .hnbgu-upload-form, .hnbgu-login-form {
        margin: 10px;
        padding: 15px;
    }
    
    #image-preview {
        grid-template-columns: repeat(2, 1fr);
    }
}