/* Component Styles */

/* Forms */
.forms-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.forms-list {
    padding: 20px;
}

.form-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.form-item:hover {
    border-color: #0078d4;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.1);
}

.form-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.form-item-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.form-item-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.form-item-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.form-item-actions {
    display: flex;
    gap: 10px;
}

/* Form Builder */
.form-builder {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.form-builder-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.form-builder-content {
    padding: 20px;
}

.form-field {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.form-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.form-field-title {
    font-weight: 600;
    color: #333;
}

.form-field-type {
    font-size: 12px;
    color: #0078d4;
    background: #e3f2fd;
    padding: 4px 8px;
    border-radius: 4px;
}

.form-field-controls {
    display: flex;
    gap: 5px;
}

.form-field-controls button {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    background: #6c757d;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.form-field-controls button:hover {
    background: #5a6268;
}

.form-field-controls .btn-danger {
    background: #dc3545;
}

.form-field-controls .btn-danger:hover {
    background: #c82333;
}

/* Form Rendering */
.form-renderer {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;
}

.form-renderer h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group label.required::after {
    content: " *";
    color: #dc3545;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

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

.form-group .form-help {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.form-group .form-error {
    font-size: 12px;
    color: #dc3545;
    margin-top: 5px;
}

/* Templates */
.templates-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.templates-list {
    padding: 20px;
}

.template-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.template-item:hover {
    border-color: #0078d4;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.1);
}

.template-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.template-item-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.template-item-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.template-item-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.template-item-actions {
    display: flex;
    gap: 10px;
}

/* Admin Components */
.admin-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.admin-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.tab-btn {
    padding: 15px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #0078d4;
    border-bottom-color: #0078d4;
    background: white;
}

.tab-btn:hover {
    color: #333;
    background: #f0f0f0;
}

.admin-content {
    padding: 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* User Management */
.users-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #0078d4;
}

.user-details h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 2px;
}

.user-details p {
    font-size: 14px;
    color: #666;
}

.user-roles {
    display: flex;
    gap: 10px;
}

.role-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.role-badge.admin {
    background: #dc3545;
    color: white;
}

.role-badge.manager {
    background: #ffc107;
    color: #333;
}

.role-badge.user {
    background: #28a745;
    color: white;
}

/* Audit Logs */
.audit-logs {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.audit-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.audit-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.audit-item-action {
    font-weight: 600;
    color: #333;
}

.audit-item-timestamp {
    font-size: 12px;
    color: #999;
}

.audit-item-details {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.audit-item-user {
    font-weight: 500;
    color: #0078d4;
}

/* Settings */
.settings-form {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.settings-form .form-group {
    margin-bottom: 20px;
}

.settings-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.settings-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

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

.loading i {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-item-header,
    .template-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .form-item-actions,
    .template-item-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 120px;
    }
    
    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .user-roles {
        width: 100%;
        justify-content: flex-start;
    }
}
