/* ===================================
   Barter VPS Dashboard - Main Styles
   =================================== */

/* CSS Variables */
:root {

    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #242438;
    --bg-hover: #2d2d44;
    
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: #818cf8;
    
    --success: #10b981;
    --success-hover: #059669;
    --error: #ef4444;
    --error-hover: #dc2626;
    --warning: #f59e0b;
    
    --border-color: #27272a;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    
    --transition: all 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-primary);
}

/* ===================================
   Login Page
   =================================== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #16213e 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===================================
   Forms
   =================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(161, 161, 170, 0.2);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-group textarea.code-input {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 13px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(161, 161, 170, 0.2);
}

/* Number Input Styling */
.form-group input[type="number"] {
    -moz-appearance: textfield;
}

.form-group input[type="number"]::-webkit-inner-spin-button,
.form-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
    opacity: 1;
    width: 20px;
    height: 20px;
    background: var(--bg-hover);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.form-group input[type="number"]::-webkit-inner-spin-button:hover,
.form-group input[type="number"]::-webkit-outer-spin-button:hover {
    background: var(--accent-primary);
}

/* File Input Styling */
.form-group input[type="file"] {
    padding: 0;
    border: 2px dashed rgba(161, 161, 170, 0.3);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.form-group input[type="file"]:hover {
    border-color: rgba(161, 161, 170, 0.5);
    background: var(--bg-hover);
}

.form-group input[type="file"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input[type="file"]::file-selector-button {
    padding: 10px 20px;
    background: var(--accent-primary);
    color: var(--text-primary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    margin-right: 16px;
    transition: var(--transition);
}

.form-group input[type="file"]::file-selector-button:hover {
    background: var(--accent-hover);
}

/* For Firefox */
.form-group input[type="file"]::file-selector-button {
    margin-right: 16px;
}

/* iOS-style Toggle Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 2px;
    background-color: var(--text-secondary);
    transition: all 0.3s ease;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: white;
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-label {
    color: var(--text-primary);
    font-size: 14px;
    user-select: none;
}

/* ===================================
   Buttons
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
}

.btn-error {
    background: var(--error);
    color: white;
}

.btn-error:hover:not(:disabled) {
    background: var(--error-hover);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

/* ===================================
   Alerts
   =================================== */

.alert {
    padding: 14px 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: #6ee7b7;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: #fcd34d;
}

/* ===================================
   Dashboard Layout
   =================================== */

.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-toggle {
    display: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px;
    cursor: pointer;
}

.logout-link {
    display: inline-flex;
}

/* ===================================
   Dashboard Content
   =================================== */

.dashboard-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 20px;
    width: 100%;
}

/* Page Tabs */
.page-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    padding: 6px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.page-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
}

.page-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.page-tab.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.page-tab-content {
    display: none;
}

.page-tab-content.active {
    display: block;
}

/* Section Links Navigation */
.section-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.section-tag:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.section-tag svg {
    width: 16px;
    height: 16px;
}

/* Remove old Coolify section styles - no longer needed */

.coolify-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===================================
   Sections
   =================================== */

.section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 100px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.section-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-light);
}

.section-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

/* ===================================
   Links Grid
   =================================== */

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.link-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    transition: var(--transition);
}

.link-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.link-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
    padding: 4px;
    margin: -4px -4px 8px -4px;
}

.link-header:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.link-header:hover .link-title {
    color: var(--accent-light);
}

.link-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-light);
    flex-shrink: 0;
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.link-url {
    font-size: 13px;
    color: var(--text-secondary);
    word-break: break-all;
    display: none; /* Hidden - URL now in Link Details accordion */
}

.link-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.link-actions .btn {
    flex: 1;
}

/* ===================================
   Credentials Accordion
   =================================== */

.credentials-accordion {
    margin-top: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.credentials-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    transition: var(--transition);
}

.credentials-toggle:hover {
    color: var(--text-primary);
}

.credentials-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.credentials-toggle.active svg {
    transform: rotate(180deg);
}

.credentials-content {
    display: none;
    padding-top: 12px;
    animation: slideDown 0.2s ease;
}

.credentials-content.active {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Link Details Accordion (same styling as credentials) */
.link-details-accordion {
    margin-top: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.link-details-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    transition: var(--transition);
}

.link-details-toggle:hover {
    color: var(--text-primary);
}

.link-details-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.link-details-toggle.active svg {
    transform: rotate(180deg);
}

.link-details-content {
    display: none;
    padding-top: 12px;
    animation: slideDown 0.2s ease;
}

.link-details-content.active {
    display: block;
}

.credential-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
}

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

.credential-label {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 80px;
}

.credential-value {
    flex: 1;
    font-size: 13px;
    font-family: 'Monaco', 'Courier New', monospace;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.credential-copy {
    padding: 4px 8px;
    font-size: 12px;
}

/* ===================================
   Modal
   =================================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-wide {
    max-width: 1400px;
}

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

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.modal-close svg {
    width: 24px;
    height: 24px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-body-vertical {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.action-details-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 0;
}

.action-details-form {
    min-width: 0;
}

.action-details-preview {
    min-width: 0;
    position: sticky;
    top: 0;
    align-self: start;
}

.body-fields-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.body-fields-form {
    min-width: 0;
}

.body-fields-preview {
    min-width: 0;
    position: sticky;
    top: 0;
    align-self: start;
}

.preview-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.preview-section {
    margin-bottom: 24px;
}

.preview-form {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
}

.preview-form .form-group {
    margin-bottom: 16px;
}

.preview-form .form-group:last-child {
    margin-bottom: 0;
}

.form-section-divider {
    height: 1px;
    background: var(--border-color);
    margin: 32px 0;
}

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

/* ===================================
   Tabs
   =================================== */

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tab-button:hover {
    color: var(--text-primary);
}

.tab-button.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* ===================================
   Lists
   =================================== */

.list {
    list-style: none;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
}

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

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ===================================
   Credential Field Item
   =================================== */

.credential-field-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.credential-field-item .form-group {
    margin-bottom: 12px;
}

.credential-field-item .form-group:last-child {
    margin-bottom: 0;
}

.credential-field-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.credential-field-remove:hover {
    background: var(--error-hover);
}

.credential-field-remove svg {
    width: 16px;
    height: 16px;
}

/* ===================================
   EasyMDE Dark Theme Overrides
   =================================== */

.EasyMDEContainer {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
}

.EasyMDEContainer .CodeMirror {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

.EasyMDEContainer .CodeMirror-cursor {
    border-left-color: var(--text-primary);
}

.EasyMDEContainer .editor-toolbar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.EasyMDEContainer .editor-toolbar button {
    color: var(--text-secondary) !important;
    border: none !important;
}

.EasyMDEContainer .editor-toolbar button:hover,
.EasyMDEContainer .editor-toolbar button.active {
    background: var(--bg-hover);
    color: var(--text-primary) !important;
    border: none !important;
}

.EasyMDEContainer .editor-toolbar i.separator {
    border-left-color: var(--border-color);
    border-right-color: var(--border-color);
}

.EasyMDEContainer .CodeMirror-selected {
    background: var(--accent-primary) !important;
    opacity: 0.3;
}

.EasyMDEContainer .editor-preview,
.EasyMDEContainer .editor-preview-side {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.EasyMDEContainer .editor-preview pre,
.EasyMDEContainer .editor-preview-side pre {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.EasyMDEContainer .CodeMirror-fullscreen {
    background: var(--bg-primary);
    z-index: 10001;
}

.editor-toolbar.fullscreen {
    z-index: 10002;
    background: var(--bg-secondary);
}

/* ===================================
   Actions Page
   =================================== */

.actions-header {
    margin-bottom: 32px;
}

.actions-header h2 {
    margin-bottom: 8px;
}

.actions-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Accordion for Logs */
.accordion {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-top: 16px;
}

.accordion-header {
    width: 100%;
    background: var(--bg-secondary);
    border: none;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    font-family: inherit;
}

.accordion-header:hover {
    background: var(--bg-hover);
}

.accordion-header svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.accordion-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.accordion-content {
    display: none;
    background: var(--bg-tertiary);
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.terminal-log {
    background: #1a1a1a;
    color: #00ff00;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 13px;
    padding: 16px;
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
    white-space: pre;
    line-height: 1.6;
    margin: 0;
    border: 1px solid #333;
}

.logs-section {
    margin-bottom: 16px;
}

.logs-section:last-child {
    margin-bottom: 0;
}

.logs-section h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.logs-section .code-block {
    margin: 0;
    max-height: 300px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.action-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.action-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.action-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.method-badge {
    padding: 4px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.method-badge.method-get {
    background: rgba(34, 197, 94, 0.15);
    color: rgb(34, 197, 94);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.method-badge.method-post {
    background: rgba(59, 130, 246, 0.15);
    color: rgb(59, 130, 246);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.method-badge.method-put {
    background: rgba(251, 146, 60, 0.15);
    color: rgb(251, 146, 60);
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.method-badge.method-patch {
    background: rgba(168, 85, 247, 0.15);
    color: rgb(168, 85, 247);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.method-badge.method-delete {
    background: rgba(239, 68, 68, 0.15);
    color: rgb(239, 68, 68);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.action-card-top code {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Courier New', monospace;
}

.action-card h3 {
    font-size: 16px;
    margin: 0;
    color: var(--text-primary);
}

.action-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.action-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.action-meta .chip {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-meta .chip svg {
    width: 14px;
    height: 14px;
}

.action-card .run-label {
    margin-top: 4px;
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-card .run-label svg {
    width: 16px;
    height: 16px;
}

/* Action Management Styles */
.action-section-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.action-section-item h4 {
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.action-section-item .section-actions {
    display: flex;
    gap: 8px;
}

.action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
}

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

.action-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.action-item-info strong {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Responsive adjustments for actions */
@media (max-width: 768px) {
    .actions-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .action-card {
        padding: 16px;
    }
    
    .actions-header {
        margin-bottom: 24px;
    }
}

/* ===================================
   Mobile Navigation
   =================================== */

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 20px;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.mobile-nav.active {
    transform: translateX(0);
}

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

.mobile-nav-header h3 {
    font-size: 18px;
}

.mobile-nav-links {
    list-style: none;
}

.mobile-nav-links li {
    margin-bottom: 8px;
}

.mobile-nav-links a,
.mobile-nav-links button.section-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    transition: var(--transition);
    width: 100%;
    border: none;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}

.mobile-nav-links a:hover,
.mobile-nav-links button.section-link:hover {
    background: var(--bg-hover);
    color: var(--accent-light);
}

.mobile-nav-links svg {
    width: 20px;
    height: 20px;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-nav {
        display: block;
    }
    
    .header-content {
        gap: 12px;
    }
    
    .header-title h1 {
        font-size: 20px;
    }
    
    .nav-links {
        gap: 8px;
    }
    
    .nav-links > a[href*="coolify"],
    .nav-links .logout-link,
    .nav-links #serverNotesBtn {
        display: none;
    }
    
    .dashboard-content {
        padding: 20px 16px;
    }
    
    .section-links {
        display: none;
    }
    
    .section {
        padding: 20px 16px;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .modal {
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .section-header {
        flex-wrap: wrap;
    }
    
    .section-actions {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 28px 24px;
    }
    
    .link-actions {
        flex-direction: column;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* ===================================
   Utilities
   =================================== */

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden {
    display: none !important;
}

/* ===================================
   Animations
   =================================== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.code-block {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    max-height: 240px;
    overflow: auto;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 13px;
    color: var(--text-primary);
}

.body-field-row {
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    margin-bottom: 12px;
    background: var(--bg-tertiary);
}

