/* Import variables */
@import 'variables.css';

/* Main containers and grid */
.ds-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.ds-page--dark {
    background: #030919; /* №95: the page colour of the Figma "Ilia theme" (was --color-dark-blue) */
}

/* П-091, П-103: on stage every page is green - sign-in pages and all pages after sign-in (production stays blue).
   The layouts add "Staging"/"Development" (ds-page) or "env-staging" (home_page) only outside production */
.ds-page.ds-page--dark.Staging,
.ds-page.ds-page--dark.Development,
.home_page.dark.env-staging {
    background: linear-gradient(180deg, rgb(0, 102, 0) 0%, #000000 70%);
}

.ds-page.ds-page--dark.Staging .ellipse_left,
.ds-page.ds-page--dark.Staging .ellipse_right,
.ds-page.ds-page--dark.Development .ellipse_left,
.ds-page.ds-page--dark.Development .ellipse_right,
.home_page.dark.env-staging .ellipse_left,
.home_page.dark.env-staging .ellipse_right {
    background: var(--glow-green);
}


/* Gradient decorative elements */
.ds-effect-left {
    /* №77: no filter - a larger box with soft gradients, same centre and turn as the former 665x348 blurred box */
    display: flex;
    flex: none;
    position: fixed; /* Fix position of decorative elements */
    width: 2340px;
    height: 1880px;
    left: -1337.5px;
    bottom: -816px;
    background: var(--glow-blue);
    transform: rotate(155deg);
    z-index: 1;
    pointer-events: none; /* Allow scrolling through this element */
}

.ds-effect-right {
    /* №77: no filter - a larger box with soft gradients, same centre and turn as the former 665x348 blurred box */
    display: flex;
    flex: none;
    position: fixed; /* Fix position of decorative elements */
    width: 2340px;
    height: 1880px;
    right: -1337.5px;
    top: -966px;
    background: var(--glow-blue);
    transform: rotate(-23deg);
    z-index: 1;
    pointer-events: none; /* Allow scrolling through this element */
}

/* Main structure */
.ds-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    min-height: 0; /* Allow container to shrink */
}

/* Layout container - main content wrapper */
.ds-layout-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--spacing-xl) var(--spacing-md) 0 var(--spacing-md);
    gap: var(--spacing-sm);
    width: 100vw;
    max-width: var(--width-main-container);
    height: 100vh;
    border-radius: var(--radius-xl);
    flex: none;
    order: 0;
    flex-grow: 0;
    z-index: 2;
    overflow: hidden; /* Важно: контролируем скролл на уровне контейнера */
    margin: 0 auto;
}

.ds-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0 var(--spacing-2xl) 0;
    gap: var(--spacing-sm);
    width: 100%;
    z-index: 3;
    flex-shrink: 0; /* Prevent header from shrinking */
    flex-grow: 0; /* Prevent header from growing */
}

.ds-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    overflow-y: auto; /* Add vertical scrolling */
    padding-bottom: var(--spacing-xl); /* Add bottom padding */
    /*z-index: 2;*/
    scrollbar-width: none; /*Hide scrollbar*/
}

.ds-sidebar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--spacing-md) 0;
    gap: var(--spacing-md);
    width: 370px;
    z-index: 2;
    flex-shrink: 0; /* Prevent sidebar from shrinking */
}

.ds-row {
    display: flex;
    flex-direction: row;
    width: 100%;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md); /* Add spacing between rows */
}

.ds-row-nowrap{
    display: flex;
    flex-direction: row;
    width: 100%;
    margin-bottom: var(--spacing-md); /* Add spacing between rows */
}

/* Form row component - for form fields with consistent spacing */
.ds-form-row {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: var(--spacing-md);
}

/* Remove bottom margin from last form row */
.ds-form-row:last-child {
    margin-bottom: 0;
}

.ds-col {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 300px; /* Minimum column width */
}

/* Special containers */
.ds-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 9, 25, 0.6); /* Rectangle 52 from Figma */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 4; /* Higher than header/navigation */
}

.ds-modal {
    background: var(--color-gray-200);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 30px;
    backdrop-filter: var(--blur-effect-s);
    box-shadow: 0px 0px 0px 1px rgba(218, 212, 244, 1), 0px 4px 24px 0px rgba(0, 0, 0, 0.32);
    padding: 24px;
    max-width: 90vw; /* Limit modal width */
    margin-top: 95px; /* Fixed vertical position from Figma */
    /*z-index: calc(var(--z-index-overlay) + 1);*/
    max-height: 80vh; /* Limit modal height */
    overflow-y: auto; /* Add scrolling in modal */
}

/* Modal title styling */
.ds-modal-title {
    max-width: 280px; /* Constrain title width for wrapping */
    line-height: 1.3; /* Better line height for multi-line text */
}
