/**
 * MyDashboards Public CSS
 */

/* General */
.mydashboards-container {
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.mydashboards-notice {
    margin: 15px 0;
    padding: 10px 15px;
    border-radius: 4px;
    position: relative;
}

.mydashboards-notice.notice-success {
    background-color: #ecf7ed;
    border-left: 4px solid #46b450;
}

.mydashboards-notice.notice-error {
    background-color: #f7ecec;
    border-left: 4px solid #dc3232;
}

.mydashboards-notice.notice-warning {
    background-color: #fff8e5;
    border-left: 4px solid #ffb900;
}

.mydashboards-notice.notice-info {
    background-color: #e5f5fa;
    border-left: 4px solid #00a0d2;
}

.mydashboards-notice .notice-dismiss {
    position: absolute;
    top: 5px;
    right: 5px;
    border: none;
    margin: 0;
    padding: 5px;
    background: none;
    color: #72777c;
    cursor: pointer;
}

.mydashboards-notice .notice-dismiss:hover {
    color: #dc3232;
}

/* Dashboard Header */
.mydashboards-header {
    margin-bottom: 20px;
}

.mydashboards-title {
    font-size: 24px;
    margin: 0 0 10px;
}

/* Grid Stack */
.mydashboards-grid {
    background-color: #f9f9f9;
    border-radius: 4px;
    padding: 10px;
    min-height: 400px;
}

.grid-stack-item-content {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.mydashboards-widget {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mydashboards-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #eee;
}

.mydashboards-widget-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.mydashboards-widget-actions {
    display: flex;
}

.mydashboards-widget-edit,
.mydashboards-widget-remove {
    background: none;
    border: none;
    padding: 2px;
    margin-left: 5px;
    cursor: pointer;
    color: #72777c;
}

.mydashboards-widget-edit:hover {
    color: #007cba;
}

.mydashboards-widget-remove:hover {
    color: #dc3232;
}

.mydashboards-widget-content {
    padding: 15px;
    flex: 1;
    overflow: auto;
}

.widget-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Widget Specific Styles */
.mydashboards-widget-stats .stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.mydashboards-widget-stats .stat-item {
    background-color: #f9f9f9;
    border-radius: 4px;
    padding: 15px;
    text-align: center;
}

.mydashboards-widget-stats .stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #007cba;
    margin-bottom: 5px;
}

.mydashboards-widget-stats .stat-label {
    font-size: 12px;
    color: #666;
}

.mydashboards-widget-recent-posts .recent-posts-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mydashboards-widget-recent-posts .recent-post-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.mydashboards-widget-recent-posts .recent-post-item:last-child {
    border-bottom: none;
}

.mydashboards-widget-recent-posts .post-title {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    text-decoration: none;
}

.mydashboards-widget-recent-posts .post-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.mydashboards-widget-recent-posts .post-excerpt {
    font-size: 13px;
}

.mydashboards-widget-chart .chart-container {
    width: 100%;
    height: 300px;
}

.mydashboards-widget-welcome {
    text-align: center;
    padding: 20px 0;
}

.mydashboards-widget-welcome .welcome-title {
    font-size: 24px;
    margin-bottom: 15px;
}

.mydashboards-widget-welcome .welcome-message {
    font-size: 14px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Dashboard Actions */
.mydashboards-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

.mydashboards-actions button {
    margin-left: 10px;
    padding: 8px 16px;
    background-color: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.mydashboards-actions button:hover {
    background-color: #0069a8;
}

.mydashboards-actions button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.mydashboards-actions button .dashicons {
    margin-right: 5px;
}

/* Modal */
.mydashboards-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.mydashboards-modal.open {
    display: flex;
}

.mydashboards-modal-content {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 600px;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.mydashboards-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.mydashboards-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.mydashboards-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #72777c;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
}

.mydashboards-modal-close:hover {
    color: #dc3232;
}

.mydashboards-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 60px);
}

.mydashboards-form-group {
    margin-bottom: 15px;
}

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

.mydashboards-form-group input[type="text"],
.mydashboards-form-group input[type="number"],
.mydashboards-form-group select,
.mydashboards-form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.mydashboards-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.mydashboards-form-actions button {
    margin-left: 10px;
    padding: 8px 16px;
    background-color: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.mydashboards-form-actions button.mydashboards-modal-cancel {
    background-color: #f1f1f1;
    color: #333;
}

.mydashboards-form-actions button:hover {
    opacity: 0.9;
}

/* Widget Selector */
.mydashboards-widget-selector {
    display: flex;
    flex-direction: column;
}

.mydashboards-widget-category {
    margin-bottom: 20px;
}

.mydashboards-widget-category h4 {
    margin: 0 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
}

.mydashboards-widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.mydashboards-widget-item {
    display: flex;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mydashboards-widget-item:hover {
    border-color: #007cba;
    background-color: #f9f9f9;
}

.mydashboards-widget-icon {
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mydashboards-widget-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #007cba;
}

.mydashboards-widget-info {
    flex: 1;
}

.mydashboards-widget-info h5 {
    margin: 0 0 5px;
    font-size: 14px;
}

.mydashboards-widget-info p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

/* Theme Styles */
.mydashboards-theme-light {
    color: #333;
}

.mydashboards-theme-dark {
    color: #f1f1f1;
    background-color: #333;
}

.mydashboards-theme-dark .mydashboards-grid {
    background-color: #222;
}

.mydashboards-theme-dark .grid-stack-item-content {
    background-color: #444;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.mydashboards-theme-dark .mydashboards-widget-header {
    background-color: #555;
    border-bottom: 1px solid #666;
}

.mydashboards-theme-dark .mydashboards-widget-title {
    color: #f1f1f1;
}

.mydashboards-theme-dark .mydashboards-widget-actions button {
    color: #ccc;
}

.mydashboards-theme-dark .mydashboards-widget-stats .stat-item {
    background-color: #555;
}

.mydashboards-theme-dark .mydashboards-widget-stats .stat-label {
    color: #ccc;
}

.mydashboards-theme-dark .mydashboards-widget-recent-posts .recent-post-item {
    border-bottom: 1px solid #555;
}

.mydashboards-theme-dark .mydashboards-widget-recent-posts .post-title {
    color: #f1f1f1;
}

.mydashboards-theme-dark .mydashboards-widget-recent-posts .post-meta {
    color: #ccc;
}

/* Responsive Styles */
@media screen and (max-width: 782px) {
    .mydashboards-actions {
        flex-direction: column;
        align-items: flex-end;
    }

    .mydashboards-actions button {
        margin-left: 0;
        margin-bottom: 10px;
        width: 100%;
        justify-content: center;
    }

    .mydashboards-modal-content {
        width: 95%;
    }
}