/* PeteIT Frontend Blog - Styles */

/* Form Container */
#peteit-blog-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-group .required {
    color: #d63638;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* Categories Dropdown */
#post_categories {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    transition: border-color 0.2s ease;
}

#post_categories:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.form-row {
    margin-bottom: 15px;
}

/* Upload Areas */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.upload-area.dragover {
    border-color: #0073aa;
    background: #e6f3ff;
    transform: scale(1.02);
}

.upload-zone {
    cursor: pointer;
    padding: 20px;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.7;
}

.upload-zone p {
    margin: 10px 0;
    color: #666;
}

.upload-zone small {
    color: #999;
}

/* File Previews */
.preview-container,
.files-container {
    margin-top: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #fff;
    transition: all 0.2s ease;
}

.file-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.file-item.preview-file img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
}

.file-item .file-icon {
    font-size: 32px;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

.file-info {
    flex: 1;
}

.file-info .filename {
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.file-info .file-link {
    text-decoration: none;
    color: #0073aa;
    font-weight: 600;
}

.file-info .file-link:hover {
    text-decoration: underline;
}

.file-meta {
    color: #666;
    font-size: 12px;
}

.file-meta span {
    margin-right: 10px;
}

.file-actions {
    display: flex;
    gap: 10px;
}

.file-actions .button {
    padding: 5px 10px;
    font-size: 12px;
    text-decoration: none;
    border-radius: 3px;
}

.file-actions .delete-file {
    background: #d63638;
    color: white;
    border: none;
    cursor: pointer;
}

.file-actions .delete-file:hover {
    background: #b32d2e;
}

/* Files Grid for Previews */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.files-grid .file-item {
    flex-direction: column;
    text-align: center;
    padding: 15px;
}

.files-grid .file-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin: 0 0 10px 0;
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #005a87);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-block;
    text-align: center;
}

.button-primary {
    background: #0073aa;
    color: white;
}

.button-primary:hover {
    background: #005a87;
    color: white;
}

.button-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.button-secondary:hover {
    background: #e0e0e0;
    color: #333;
}

.button-small {
    padding: 5px 12px;
    font-size: 12px;
}

/* Messages */
#form-messages {
    margin: 20px 0;
}

.message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: 600;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* MyCred Settings */
.mycred-settings {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.mycred-settings h3 {
    margin-top: 0;
    color: #0073aa;
}

/* Login Notice */
.peteit-login-notice,
.peteit-no-permission {
    text-align: center;
    padding: 40px 20px;
    background: #f0f8ff;
    border: 1px solid #0073aa;
    border-radius: 8px;
}

.peteit-no-permission {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.peteit-login-notice p,
.peteit-no-permission p {
    font-size: 16px;
    margin-bottom: 20px;
    color: #333;
}

.peteit-no-permission p:last-child {
    margin-bottom: 0;
}

.peteit-no-permission small {
    color: #666;
    font-size: 14px;
}

/* Content Protection Styles */
.peteit-blog-files {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.peteit-blog-files h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.peteit-blog-files h4 {
    color: #0073aa;
    margin: 20px 0 15px 0;
}

.preview-files .files-grid {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.protected-files {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #ddd;
    margin-top: 20px;
}

.access-notice,
.purchase-notice {
    text-align: center;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    margin: 15px 0;
}

.access-notice p,
.purchase-notice p {
    margin: 10px 0;
    color: #856404;
}

.price {
    font-size: 18px;
    font-weight: 600;
    color: #0073aa;
}

.files-list {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

/* Admin Styles */
.peteit-admin-files .file-item {
    background: #f9f9f9;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
}

/* Responsive Design */
@media (max-width: 768px) {
    #peteit-blog-form-container {
        margin: 10px;
        padding: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .files-grid {
        grid-template-columns: 1fr;
    }
    
    .file-item {
        flex-direction: column;
        text-align: center;
    }
    
    .file-item.preview-file img {
        margin: 0 0 10px 0;
    }
    
    .file-item .file-icon {
        margin: 0 0 10px 0;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 15px;
    }
    
    .upload-icon {
        font-size: 32px;
    }
    
    .button {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* WordPress Editor Overrides */
.wp-editor-container {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
}

/* File Upload States */
.file-uploading {
    opacity: 0.6;
}

.file-uploading .file-info::after {
    content: " (Upload läuft...)";
    color: #0073aa;
    font-style: italic;
}

.file-error {
    border-color: #d63638;
    background: #f8d7da;
}

.file-success {
    border-color: #46b450;
    background: #d4edda;
}

/* Drag and Drop States */
.upload-zone.drag-over {
    background: #e6f3ff;
    border-color: #0073aa;
    transform: scale(1.01);
}

.upload-zone.drag-over .upload-icon {
    animation: bounce 0.5s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    80% { transform: translateY(-5px); }
}
