/* Modal System for SparkSheets Mini Menu */

.mini-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-in;
}

.mini-modal {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

.mini-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.mini-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.mini-modal-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mini-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.mini-modal-body {
    color: #555;
    line-height: 1.6;
}

.mini-modal-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.mini-modal-btn {
    padding: 8px 20px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.mini-modal-btn-primary {
    background: #4CAF50;
    color: white;
}

.mini-modal-btn-primary:hover {
    background: #45a049;
}

.mini-modal-btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.mini-modal-btn-secondary:hover {
    background: #e0e0e0;
    color: #333;
}

.mini-modal-btn-danger {
    background: #f44336;
    color: white;
}

.mini-modal-btn-danger:hover {
    background: #d32f2f;
}

/* Form styles for modals */
.mini-modal-form-group {
    margin-bottom: 16px;
}

.mini-modal-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.mini-modal-input,
.mini-modal-select,
.mini-modal-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.mini-modal-input:focus,
.mini-modal-select:focus,
.mini-modal-textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.mini-modal-textarea {
    min-height: 100px;
    resize: vertical;
}

/* List styles for modals */
.mini-modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mini-modal-list-item {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #f8f8f8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.mini-modal-list-item:hover {
    background: #f0f0f0;
}

.mini-modal-list-item button {
    padding: 4px 12px;
    border-radius: 4px;
    border: none;
    font-size: 12px;
    cursor: pointer;
    background: white;
    color: #666;
    transition: all 0.2s;
}

.mini-modal-list-item button:hover {
    background: #4CAF50;
    color: white;
}

/* Info box styles */
.mini-modal-info {
    background: #e3f2fd;
    border-left: 4px solid #2196F3;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #1565C0;
}

.mini-modal-warning {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #e65100;
}

/* Grid layout for settings */
.mini-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.mini-modal-grid-item {
    padding: 16px;
    background: #f8f8f8;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.mini-modal-grid-item:hover {
    background: #4CAF50;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Animation keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mini-modal {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .mini-modal-header {
        border-bottom-color: #444;
    }

    .mini-modal-title {
        color: #e0e0e0;
    }

    .mini-modal-close {
        background: #444;
        color: #aaa;
    }

    .mini-modal-close:hover {
        background: #555;
        color: #fff;
    }

    .mini-modal-body {
        color: #ccc;
    }

    .mini-modal-footer {
        border-top-color: #444;
    }

    .mini-modal-input,
    .mini-modal-select,
    .mini-modal-textarea {
        background: #3d3d3d;
        border-color: #555;
        color: #e0e0e0;
    }

    .mini-modal-list-item {
        background: #3d3d3d;
    }

    .mini-modal-list-item:hover {
        background: #444;
    }

    .mini-modal-grid-item {
        background: #3d3d3d;
    }
}