/**
 * LaunchPAD Platform Styles
 * Visual Knowledge Management Platform
 */

/* Modal Styles */
.launchpad-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
}

.launchpad-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.launchpad-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.launchpad-modal-header h2 {
    margin: 0;
    font-size: 22px;
    color: #1d2327;
}

.launchpad-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #646970;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
    transition: color 0.2s;
}

.launchpad-modal-close:hover {
    color: #d63638;
}

.launchpad-modal-body {
    padding: 25px;
}

.launchpad-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #ddd;
    background: #f9f9f9;
}

/* Form Styles */
.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="url"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.form-field input[type="color"] {
    height: 40px;
    padding: 4px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Context Menu */
.launchpad-context-menu {
    min-width: 160px;
    border-radius: 3px;
}

.launchpad-context-menu .menu-item {
    white-space: nowrap;
    font-size: 13px;
    color: #1d2327;
}

.launchpad-context-menu .menu-item:hover {
    color: #2271b1;
}

/* Graph Container */
#launchpad-graph {
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Node Highlighting */
.cy-node.highlighted {
    opacity: 1 !important;
}

.cy-node:not(.highlighted) {
    opacity: 0.3;
}

.cy-edge.highlighted {
    opacity: 1 !important;
}

.cy-edge:not(.highlighted) {
    opacity: 0.2;
}

/* Loading State */
.launchpad-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    font-size: 16px;
    color: #646970;
}

.launchpad-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f0f0f1;
    border-top-color: #2271b1;
    border-radius: 50%;
    margin-right: 10px;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.launchpad-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #646970;
}

.launchpad-empty-state .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    opacity: 0.3;
    margin-bottom: 20px;
}

.launchpad-empty-state h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #1d2327;
}

.launchpad-empty-state p {
    margin: 0 0 25px;
    font-size: 14px;
}

/* Notice Styles */
.notice.launchpad-notice {
    margin: 15px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .launchpad-modal-content {
        width: 95%;
        max-width: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .launchpad-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Frontend Shortcode Styles */
.launchpad-shortcode-container {
    position: relative;
    margin: 20px 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.launchpad-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
}

.launchpad-controls-left,
.launchpad-controls-right {
    display: flex;
    gap: 8px;
}

.launchpad-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    font-size: 13px;
    color: #1d2327;
    cursor: pointer;
    transition: all 0.2s;
}

.launchpad-btn:hover {
    background: #f0f0f1;
    border-color: #646970;
}

.launchpad-btn.primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.launchpad-btn.primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.launchpad-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Search Box */
.launchpad-search {
    position: relative;
    margin-right: 10px;
}

.launchpad-search input {
    padding: 6px 12px 6px 32px;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    font-size: 13px;
    width: 200px;
    transition: width 0.3s;
}

.launchpad-search input:focus {
    width: 250px;
    outline: none;
    border-color: #2271b1;
}

.launchpad-search .dashicons {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #646970;
}

/* Node Info Panel */
.launchpad-info-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    background: #fff;
    border-left: 1px solid #ddd;
    padding: 20px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s;
    z-index: 10;
}

.launchpad-info-panel.open {
    transform: translateX(0);
}

.launchpad-info-panel h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #1d2327;
}

.launchpad-info-panel .info-item {
    margin-bottom: 15px;
}

.launchpad-info-panel .info-label {
    font-weight: 600;
    color: #646970;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.launchpad-info-panel .info-value {
    color: #1d2327;
    font-size: 14px;
}

/* Legend */
.launchpad-legend {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 15px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 12px;
    z-index: 5;
}

.launchpad-legend h4 {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
}

.launchpad-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.launchpad-legend-item:last-child {
    margin-bottom: 0;
}

.launchpad-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.launchpad-legend-label {
    color: #646970;
}

/* Minimap */
.launchpad-minimap {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    z-index: 5;
}

/* Tooltips */
.launchpad-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 9999;
    max-width: 200px;
    word-wrap: break-word;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.launchpad-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Print Styles */
@media print {
    .launchpad-controls,
    .launchpad-info-panel,
    .launchpad-legend,
    .launchpad-minimap {
        display: none !important;
    }

    .launchpad-shortcode-container {
        border: none;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    .launchpad-modal-content {
        background: #1d2327;
        color: #f0f0f1;
    }

    .launchpad-modal-header {
        border-bottom-color: #3c434a;
    }

    .launchpad-modal-footer {
        background: #23282d;
        border-top-color: #3c434a;
    }

    .form-field input,
    .form-field textarea,
    .form-field select {
        background: #2c3338;
        color: #f0f0f1;
        border-color: #3c434a;
    }
}

/* Accessibility */
.launchpad-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
.launchpad-btn:focus-visible,
.form-field input:focus-visible,
.form-field textarea:focus-visible,
.form-field select:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}
