/* Widget Configuration UI Styles */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

/* Modal Content */
.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
}

/* Item Editor Modal */
.item-editor-modal {
    width: 800px;
    max-width: 90vw;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s ease-in-out;
}

.close-btn:hover {
    color: #000;
    background-color: #f8f9fa;
}

/* Modal Body */
.modal-body {
    padding: 1.5rem;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
}

/* Widget Configuration Container */
.widget-configuration-container {
    padding: 1rem;
}

.widget-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.config-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
}

.config-actions {
    display: flex;
    gap: 0.5rem;
}

/* Widget Grid */
.widget-grid-container {
    margin-bottom: 2rem;
}

.widget-grid {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    min-height: 400px;
}

.widget-preview {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.widget-preview:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.widget-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.widget-preview-header.selected {
    border-bottom: 2px solid #0d6efd;
    padding-bottom: 0.5rem;
}

.widget-preview-title {
    font-weight: 600;
    font-size: 1rem;
}

.widget-preview-actions {
    display: flex;
    gap: 0.25rem;
}

.widget-action-btn {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.widget-action-btn:hover {
    background-color: #f8f9fa;
}

.widget-action-btn.delete {
    color: #dc3545;
    border-color: #dc3545;
}

.widget-action-btn.delete:hover {
    background-color: #dc3545;
    color: white;
}

.widget-preview-content {
    color: #6c757d;
    font-size: 0.875rem;
}

.widget-size-info,
.widget-position-info {
    margin-bottom: 0.25rem;
}

/* Add Widget Area */
.add-widget-area {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #0d6efd;
    border-radius: 8px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    grid-column: 1 / -1;
}

.add-widget-area:hover {
    background-color: #f8f9fa;
    border-color: #0a58ca;
}

.add-widget-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #0d6efd;
}

.add-widget-content i {
    font-size: 2rem;
}

.add-widget-content span {
    font-weight: 500;
}

/* Widget Items Section */
.widget-items-section {
    margin-top: 2rem;
}

.items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.items-header h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.add-item-buttons {
    display: flex;
    gap: 0.5rem;
}

.add-item-btn {
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-item-btn:hover {
    background-color: #0a58ca;
}

.add-item-btn i {
    font-size: 1rem;
}

/* Items List */
.items-list {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.item-card {
    border-bottom: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.item-card:last-child {
    border-bottom: none;
}

.item-card.selected {
    background-color: #e3f2fd;
    border-color: #0d6efd;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.item-header:hover {
    background-color: #f8f9fa;
}

.item-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.item-type {
    font-weight: 600;
    color: #0d6efd;
}

.item-order {
    color: #6c757d;
    font-size: 0.875rem;
}

.item-actions {
    display: flex;
    gap: 0.25rem;
}

.item-action-btn {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.item-action-btn:hover {
    background-color: #f8f9fa;
}

.item-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.item-action-btn.delete {
    color: #dc3545;
    border-color: #dc3545;
}

.item-action-btn.delete:hover {
    background-color: #dc3545;
    color: white;
}

/* Item Editor */
.item-editor {
    padding: 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.base-properties {
    margin-bottom: 1.5rem;
}

.item-specific-properties {
    margin-top: 1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.25rem;
}

/* Dashboard Settings */
.dashboard-settings {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.dashboard-settings h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
}

.setting-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

/* Button Styles */
.primary-action {
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-action:hover {
    background-color: #0a58ca;
}

.secondary-action {
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.secondary-action:hover {
    background-color: #5a6268;
}

/* No Items Message */
.no-items-message {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.no-items-message p {
    margin: 0;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .item-editor-modal {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .add-item-buttons {
        flex-wrap: wrap;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}