/* Base Embed Layout Styles */
/* Styles specific to embedded/iframe views */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dashboard-bg, var(--bg-primary, #0f172a));
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Hide scrollbar but keep functionality */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.embed-wrapper {
    padding: 10px 20px;
    min-height: 100vh;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Ensure modals work correctly with position: fixed */
html, body {
    height: 100%;
    overflow-x: hidden;
}

/* Buttons */
.action-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.action-btn:hover {
    background: var(--bg-darker);
    border-color: var(--accent-blue);
}

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

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

.action-btn.danger {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

.action-btn.success {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

/* Cards */
.card,
.dashboard-card {
    background: var(--card-bg, rgba(30, 41, 59, 0.8));
    border: 1px solid var(--border-color, rgba(51, 65, 85, 0.6));
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.card-header,
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color, rgba(51, 65, 85, 0.5));
}

.card-title,
.widget-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary, #f1f5f9);
}

.page-container {
    max-width: 100vw;
    margin: 0 0 0 0
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary, #f1f5f9);
}

/* Form elements */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

tr:hover {
    background: rgba(255,255,255,0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--border-color, rgba(51, 65, 85, 0.6));
    background: var(--card-bg, rgba(30, 41, 59, 0.8));
    color: var(--text-primary, #f1f5f9);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--bg-darker, rgba(15, 23, 42, 0.9));
    border-color: var(--accent-blue, #3b82f6);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue, #3b82f6), #2563eb);
    border-color: var(--accent-blue, #3b82f6);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(51, 65, 85, 0.5);
    border-color: rgba(71, 85, 105, 0.6);
}

.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.8);
}

.btn-danger {
    background: var(--accent-red, #ef4444);
    border-color: var(--accent-red, #ef4444);
    color: white;
}

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

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* Global Toast Container for stacking */
.global-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    max-width: 400px;
}

.global-toast {
    width: 360px;
    padding: 0;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transform: translateX(420px);
    opacity: 0;
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid transparent;
    position: relative;
}

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

.global-toast-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.global-toast-header .global-toast-icon {
    font-size: 16px;
}

.global-toast-header .global-toast-title {
    flex: 1;
}

.global-toast-header .global-toast-close {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
}

.global-toast-header .global-toast-close:hover {
    opacity: 1;
}

.global-toast-body {
    padding: 16px;
    font-size: 13px;
    line-height: 1.5;
}

.global-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: rgba(255,255,255,0.3);
    width: 0%;
    transition: width linear;
}

.global-toast.success {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    border-color: #10b981;
    color: #d1fae5;
}
.global-toast.success .global-toast-header {
    background: rgba(0,0,0,0.15);
    color: #ecfdf5;
}

.global-toast.error {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    border-color: #ef4444;
    color: #fecaca;
}
.global-toast.error .global-toast-header {
    background: rgba(0,0,0,0.15);
    color: #fef2f2;
}

.global-toast.warning {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    border-color: #f59e0b;
    color: #fef3c7;
}
.global-toast.warning .global-toast-header {
    background: rgba(0,0,0,0.15);
    color: #fffbeb;
}

.global-toast.info {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
    border-color: #3b82f6;
    color: #dbeafe;
}
.global-toast.info .global-toast-header {
    background: rgba(0,0,0,0.15);
    color: #eff6ff;
}
