/**
 * H5P Frontend Extension - CSS Styles
 * Save as: assets/css/h5p-frontend.css
 */

/* Base wrapper styles */
.h5p-frontend-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Form container styles */
.h5p-frontend-create-form,
.h5p-frontend-edit-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.h5p-frontend-create-form h3,
.h5p-frontend-edit-form h3 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

/* Field styles */
.h5p-frontend-field {
    margin-bottom: 20px;
}

.h5p-frontend-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.h5p-frontend-field input[type="text"],
.h5p-frontend-field input[type="file"],
.h5p-frontend-field textarea,
.h5p-frontend-field select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.h5p-frontend-field input[type="text"]:focus,
.h5p-frontend-field textarea:focus,
.h5p-frontend-field select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.h5p-frontend-field small {
    color: #666;
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

/* Content type options */
.h5p-frontend-content-type-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.h5p-frontend-content-type-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.h5p-frontend-content-type-options label:hover {
    background-color: #f5f5f5;
    border-color: #007cba;
}

.h5p-frontend-content-type-options input[type="radio"] {
    width: auto;
    margin: 0;
}

/* Section styles */
.h5p-frontend-section {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #f9f9f9;
}

/* Editor container */
.h5p-editor-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 400px;
    background: #fff;
    position: relative;
}

#h5p-editor {
    min-height: 400px;
    padding: 20px;
}

/* Button styles */
.h5p-frontend-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1;
}

.h5p-frontend-btn-primary {
    background-color: #007cba;
    color: #fff;
}

.h5p-frontend-btn-primary:hover {
    background-color: #005a87;
    color: #fff;
}

.h5p-frontend-btn-secondary {
    background-color: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
}

.h5p-frontend-btn-secondary:hover {
    background-color: #e1e1e1;
    color: #333;
}

.h5p-frontend-btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.h5p-frontend-btn-danger:hover {
    background-color: #c82333;
    color: #fff;
}

.h5p-frontend-btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

/* Actions container */
.h5p-frontend-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Content list styles */
.h5p-frontend-content-list {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.h5p-frontend-content-list h3 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

/* Table styles */
.h5p-frontend-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

.h5p-frontend-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.h5p-frontend-table th,
.h5p-frontend-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.h5p-frontend-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.h5p-frontend-table tr:hover {
    background-color: #f5f5f5;
}

.h5p-frontend-table .h5p-frontend-actions {
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: none;
}

/* Content preview */
.h5p-frontend-content-preview {
    margin-top: 10px;
    max-width: 300px;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
}

.h5p-frontend-content-preview .h5p-content {
    max-height: 200px;
    overflow: hidden;
}

/* Pagination */
.h5p-frontend-pagination {
    margin: 30px 0;
    text-align: center;
}

.h5p-frontend-pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.h5p-frontend-pagination .page-numbers:hover,
.h5p-frontend-pagination .page-numbers.current {
    background-color: #007cba;
    color: #fff;
    border-color: #007cba;
}

/* Messages */
.h5p-frontend-messages {
    margin: 20px 0;
}

.h5p-frontend-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: 500;
}

.h5p-frontend-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.h5p-frontend-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.h5p-frontend-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Notice styles */
.h5p-frontend-notice {
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Loading styles */
.h5p-frontend-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.h5p-frontend-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: h5p-frontend-spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Responsive styles */
@media (max-width: 768px) {
    .h5p-frontend-wrapper {
        padding: 15px;
    }
    
    .h5p-frontend-create-form,
    .h5p-frontend-edit-form,
    .h5p-frontend-content-list {
        padding: 20px;
    }
    
    .h5p-frontend-content-type-options {
        flex-direction: column;
    }
    
    .h5p-frontend-actions {
        flex-direction: column;
    }
    
    .h5p-frontend-table-wrapper {
        overflow-x: scroll;
    }
    
    .h5p-frontend-table {
        min-width: 600px;
    }
    
    .h5p-frontend-content-preview {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .h5p-frontend-create-form h3,
    .h5p-frontend-edit-form h3,
    .h5p-frontend-content-list h3 {
        font-size: 20px;
    }
    
    .h5p-frontend-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .h5p-frontend-actions {
        margin-top: 20px;
    }
}