/* CSS Variables for Themes */
:root {
    /* Dark Theme (Default) */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #252525;
    --text-primary: #e0e0e0;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border-color: #404040;
    --accent-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --shadow: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    /* Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --border-color: #d1d5db;
    --accent-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    user-select: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px var(--shadow);
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-left i {
    color: var(--accent-color);
    margin-right: 8px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: var(--text-muted);
    color: white;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: var(--success-color);
    color: white;
    transition: background-color 0.2s ease;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
    transition: background-color 0.2s ease;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    transition: background-color 0.2s ease;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* Main Layout */
.main-layout {
    display: flex;
    height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    flex-shrink: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease, display 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Module Categories */
.module-categories {
    padding: 16px;
}

.category {
    margin-bottom: 24px;
}

.category h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.module-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.module-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: grab;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.module-item:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
    transform: translateX(2px);
}

.module-item:active {
    cursor: grabbing;
}

.module-item i {
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    position: relative;
    transition: background-color 0.3s ease;
}

.canvas-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    gap: 8px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.canvas-size-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.canvas-size-controls .btn {
    font-size: 0.75rem;
    padding: 4px 8px;
}

/* Pan Mode Styles */
.pan-mode .canvas {
    cursor: grab !important;
}

.pan-mode .canvas:active {
    cursor: grabbing !important;
}

.pan-mode .module {
    pointer-events: none !important;
}

.pan-mode .module * {
    pointer-events: none !important;
}

.pan-mode .connections-layer {
    pointer-events: none !important;
}

.pan-mode .connections-layer * {
    pointer-events: none !important;
}

.pan-mode .port {
    pointer-events: none !important;
}

.pan-mode .resize-handle {
    pointer-events: none !important;
}

.pan-mode-active {
    background-color: #3b82f6 !important;
    color: white !important;
}

/* Pan mode indicator */
.pan-mode-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pan-mode-indicator.show {
    opacity: 1;
}

.pan-mode-indicator i {
    margin-right: 8px;
}

/* Test button styles */
.btn-warning {
    background-color: #f59e0b;
    color: white;
    border: none;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    border: none;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.zoom-info {
    color: var(--text-muted);
    font-weight: 500;
}

.grid-toggle,
.snap-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.grid-toggle input,
.snap-toggle input {
    margin: 0;
}

/* Canvas */
.canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: auto;
}

.canvas {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 2000px;
    min-height: 1500px;
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 8px 8px;
    background-position: 0 0;
    transform-origin: 0 0;
    transition: transform 0.1s ease;
}

.canvas.no-grid {
    background-image: none;
}

.connections-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.modules-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* Module Styles */
.module {
    position: absolute;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: move;
    user-select: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px var(--shadow);
    min-width: 120px;
    min-height: 60px;
}

.module:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.module.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    z-index: 100;
}

.module.dragging {
    z-index: 1000;
    transform: rotate(2deg) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    transition: none;
    cursor: grabbing !important;
}

.module.dragging * {
    pointer-events: none;
}

.module-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px 6px 0 0;
    border-bottom: 1px solid var(--border-color);
}

.module-icon {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.module-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.module-body {
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.module-cost {
    font-weight: 600;
    color: var(--success-color);
    margin-bottom: 4px;
}

.module-role {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

/* Module Sizes */
.module.size-s {
    width: 180px;
    min-height: 80px;
}

.module.size-m {
    width: 240px;
    min-height: 120px;
}

.module.size-l {
    width: 320px;
    min-height: 160px;
}

/* Resize Handles */
.module .resize-handle {
    position: absolute;
    background: #3b82f6;
    border-radius: 50%;
    width: 8px;
    height: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.module:hover .resize-handle,
.module.selected .resize-handle {
    opacity: 1;
}

.resize-handle.nw {
    top: -4px;
    left: -4px;
    cursor: nw-resize;
}

.resize-handle.ne {
    top: -4px;
    right: -4px;
    cursor: ne-resize;
}

.resize-handle.sw {
    bottom: -4px;
    left: -4px;
    cursor: sw-resize;
}

.resize-handle.se {
    bottom: -4px;
    right: -4px;
    cursor: se-resize;
}

.resize-handle.n {
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    cursor: n-resize;
}

.resize-handle.s {
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    cursor: s-resize;
}

.resize-handle.e {
    top: 50%;
    right: -4px;
    transform: translateY(-50%);
    cursor: e-resize;
}

.resize-handle.w {
    top: 50%;
    left: -4px;
    transform: translateY(-50%);
    cursor: w-resize;
}

/* Connection Ports */
.module .port {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #3b82f6;
    border: 2px solid #ffffff;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.2s ease;
    cursor: crosshair;
}

.module:hover .port,
.module.selected .port {
    opacity: 1;
}

.port.top {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
}

.port.right {
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
}

.port.bottom {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
}

.port.left {
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
}

.port.top-left {
    top: -6px;
    left: 25%;
    transform: translateX(-50%);
}

.port.top-right {
    top: -6px;
    right: 25%;
    transform: translateX(50%);
}

.port.bottom-left {
    bottom: -6px;
    left: 25%;
    transform: translateX(-50%);
}

.port.bottom-right {
    bottom: -6px;
    right: 25%;
    transform: translateX(50%);
}

.port:hover {
    background: #10b981;
    transform: scale(1.2);
}

.port.connecting {
    background: #f59e0b;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Connection Lines */
.connection {
    stroke: #3b82f6;
    stroke-width: 2;
    fill: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.connection:hover {
    stroke: #10b981;
    stroke-width: 3;
    filter: drop-shadow(0 0 2px rgba(16, 185, 129, 0.3));
}

.connection.selected {
    stroke: #f59e0b;
    stroke-width: 4;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.5));
}

/* Connection Edit Icon */
.connection-edit-icon {
    pointer-events: all;
}

.connection-edit-icon:hover {
    opacity: 1 !important;
    transform: scale(1.1);
}

.connection-edit-icon path {
    transition: fill 0.2s ease;
}

.connection-edit-icon:hover path {
    fill: #1d4ed8;
}

/* Connection Tooltip */
.connection-tooltip {
    position: fixed;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.connection-tooltip.show {
    opacity: 1;
}

.connection-label {
    font-size: 0.75rem;
    fill: var(--text-primary);
    text-anchor: middle;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 10000;
    min-width: 180px;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.15s ease;
    pointer-events: none;
    padding: 4px 0;
}

.context-menu.show {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.context-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: background 0.2s ease;
    position: relative;
}

.context-item:hover {
    background: var(--border-color);
}

.context-item i {
    width: 16px;
    text-align: center;
}

.submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px var(--shadow);
    min-width: 140px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.15s ease;
    pointer-events: none;
    z-index: 10001;
    padding: 4px 0;
}

.context-item:hover .submenu {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.submenu-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-primary);
    transition: background 0.2s ease;
    white-space: nowrap;
}

.submenu-item:hover {
    background: var(--border-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 8px 32px var(--shadow);
    min-width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

/* Form Controls */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: border-color 0.2s ease, background-color 0.3s ease, color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Presentation Mode */
.presentation-mode .sidebar {
    display: none;
}

/* Pan Mode */
.pan-mode .sidebar {
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.presentation-mode .canvas-toolbar {
    display: none;
}

.presentation-mode .module {
    cursor: default;
}

.presentation-mode .module:hover {
    border-color: #404040;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.presentation-mode .module .resize-handle,
.presentation-mode .module .port {
    display: none;
}

/* Minimap */
.minimap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 200px;
    height: 120px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #404040;
    border-radius: 6px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.minimap.show {
    opacity: 1;
}

.minimap-viewport {
    position: absolute;
    border: 2px solid #3b82f6;
    background: rgba(59, 130, 246, 0.2);
    cursor: move;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 250px;
    }
    
    .header-actions {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .modal-content {
        min-width: 300px;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 200px;
    }
    
    .header-actions .btn span {
        display: none;
    }
    
    .header-actions .btn {
        padding: 8px;
        min-width: 40px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Selection Styles */
::selection {
    background: rgba(59, 130, 246, 0.3);
}

/* Focus Styles */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #404040;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

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

/* Tooltip */
.tooltip {
    position: absolute;
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    pointer-events: none;
    z-index: 10000;
    border: 1px solid #404040;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Connection Animation */
.connection.animated {
    stroke-dasharray: 5, 5;
    animation: dash 1s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -10;
    }
}

/* Module Drop Animation */
@keyframes moduleDrop {
    0% {
        transform: scale(0.8) rotate(-5deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(2deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Module Hover Effects */
.module-item {
    transition: all 0.2s ease;
}

.module-item:hover {
    transform: translateX(4px) scale(1.02);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.module-item:active {
    transform: translateX(2px) scale(0.98);
}

/* Smooth Module Transitions */
.module {
    transition: all 0.2s ease;
}

.module:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Drag Preview */
.module-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Canvas Drop Zone */
.canvas.drag-over {
    background-color: rgba(59, 130, 246, 0.1);
    border: 2px dashed #3b82f6;
}

/* Improved Cursor States */
.module {
    cursor: grab;
}

.module:active {
    cursor: grabbing;
}

.module.dragging {
    cursor: grabbing !important;
}

/* Connection Target Highlighting */
.connection-target {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3) !important;
    animation: pulse-green 1s infinite;
}

@keyframes pulse-green {
    0%, 100% { 
        box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
    }
    50% { 
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.5);
    }
}

/* Connection Instructions */
.connection-instructions {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: #2d2d2d;
    border: 1px solid #10b981;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.3s ease-out;
}

.instructions-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #e0e0e0;
    font-size: 0.875rem;
}

.instructions-content i {
    color: #10b981;
    font-size: 1.1rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Toast Notifications */
.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    color: #e0e0e0;
    font-size: 0.875rem;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    min-width: 200px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.toast-success i {
    color: #10b981;
}

.toast-info {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.toast-info i {
    color: #3b82f6;
}

/* Touch Improvements */
@media (hover: none) {
    .module:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .module-item:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    }
}
