@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;400&display=swap');
@import './animations.css';
@import './components/header.css';
@import './components/firmware-selector.css';
@import './components/file-input.css';
@import './components/board-selector.css';
@import './components/master-button.css';
@import './components/notification.css';
@import './components/step-block.css';
@import './components/devices-list.css';
@import './components/dev-tools.css';

:root {
    --text-color: rgb(247, 247, 240);
    --bg-color: rgb(40, 41, 53);
    --input-bg-color: rgb(30, 31, 43);
    --button-hover-color: rgb(100, 100, 110);
    --button-click-color: rgb(80, 80, 90);
    --button-disabled-color: rgb(90, 90, 100);
    --link-color: rgb(255, 104, 192);
    --link-hover-color: var(--text-color);
}

* {
    margin: 0;
    border: 0;
    box-sizing: border-box;
    outline: none;
    font-family: 'Roboto', sans-serif;
    font-weight: 100;
    text-decoration: none;
    color: var(--text-color);
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 3rem;
    background-color: var(--bg-color);
}

.app {
    width: 70%;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* Main content - контейнер для всех основных элементов с единым gap */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}

/* Additional content - инженерная лента стиль */
.additional-content {
    position: relative;
    padding: 1rem;
    border-radius: 4px;
    background-color: var(--bg-color);
    border: 4px solid transparent;
    background-clip: padding-box;
}

.additional-content::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 4px;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 215, 0, 0.25) 0px,
        rgba(255, 215, 0, 0.25) 12px,
        rgba(26, 26, 26, 0.5) 12px,
        rgba(26, 26, 26, 0.5) 24px
    );
    z-index: -1;
    pointer-events: none;
}

.additional-content > * {
    position: relative;
    z-index: 1;
    margin-top: 0;
    margin-bottom: 0;
}

.additional-content > *:first-child {
    margin-top: 0;
}

.additional-content > *:last-child {
    margin-bottom: 0;
}

input {
    margin: 0;
    padding: 5px;
    background-color: var(--input-bg-color);
    border: var(--text-color) solid 0.5px;
    border-radius: 1px;
}

input:disabled {
    color: var(--button-disabled-color);
    border: var(--button-disabled-color) solid 0.5px;
    background-color: var(--bg-color);
    cursor: not-allowed;
}

select {
    margin: 0;
    padding: 5px;
    background-color: var(--input-bg-color);
    border: var(--text-color) solid 0.5px;
    border-radius: 1px;
    color: var(--text-color);
    font-family: 'Roboto', sans-serif;
    font-weight: 100;
    cursor: pointer;
}

select:hover {
    border-color: var(--button-hover-color);
}

select:focus {
    border-color: var(--link-color);
    outline: none;
}

select:disabled {
    color: var(--button-disabled-color);
    border: var(--button-disabled-color) solid 0.5px;
    background-color: var(--bg-color);
    cursor: not-allowed;
}

select.secondary {
    color: var(--button-disabled-color);
    border: var(--button-disabled-color) solid 0.5px;
    background-color: var(--bg-color);
    opacity: 0.7;
    cursor: pointer;
}

select option {
    background-color: var(--input-bg-color);
    color: var(--text-color);
}


h1 {
    position: relative;
    font-weight: 600;
    font-size: 5rem;
    text-transform: capitalize;
    letter-spacing: 0.12rem;
    margin-bottom: 0.5rem;
    text-align: right;
    background: repeating-linear-gradient(
        -45deg,
        rgba(255, 200, 0, 0.8) 0px,
        rgba(255, 200, 0, 0.8) 18px,
        rgba(120, 85, 50, 0.55) 18px,
        rgba(120, 85, 50, 0.55) 36px
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5)) drop-shadow(-2px -2px 4px rgba(255, 215, 0, 0.2));
}

a {
    font-weight: 700;
    letter-spacing: 0.08rem;
}

.entry-boxes,
.buttons-and-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0;
}

/* buttons-and-bar теперь управляется gap в main-content */

/* Firmware configuration group - объединяет настройки файла и платы */
.firmware-config-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* File selection group - объединяет связанные элементы с меньшими отступами */
.file-selection-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

button {
    padding: 5px;
    margin: 0;
    width: 7rem;
    border: var(--text-color) solid 1px;
    border-radius: 3px;
    font-weight: 400;
    letter-spacing: 1px;
    background-color: var(--input-bg-color);
    color: var(--text-color);
    cursor: pointer;
}


button:hover {
    background-color: rgb(60, 61, 73);
    border-color: var(--link-color);
}

button:active {
    background-color: rgb(50, 51, 63);
    border-color: var(--link-color);
}

button:disabled {
    color: var(--button-disabled-color);
    border: var(--button-disabled-color) solid 1px;
    background-color: var(--input-bg-color);
    opacity: 0.6;
    cursor: not-allowed;
}

progress {
    margin-left: 1rem;
    margin-right: 10px;
    width: 100rem;
    height: 0.4rem;
    align-self: center;
}

footer {
    display: flex;
    justify-content: space-between;
    margin: 0;
}

footer p {
    margin: 0;
}

footer strong {
    color: rgba(255, 140, 0, 0.85);
    font-weight: 400;
}

footer a {
    opacity: 0.8;
}

p {
    margin-top: 1rem;
    line-height: 1.7;
    font-size: x-small;
}

a {
    font-weight: 400;
    letter-spacing: normal;
    color: var(--link-color);
}

a:hover {
    color: var(--link-hover-color);
}

/* Step-by-step controls */
.step-block {
    margin: 1rem 0 0 0;
    padding: 1rem;
    background-color: var(--input-bg-color);
    border: var(--text-color) solid 0.5px;
    border-radius: 4px;
}

.step-block:last-child {
    margin-bottom: 0;
}

/* Dev details - раскрывающийся контейнер с рамкой */
.dev-details {
    position: relative;
    opacity: 0.7;
    border-radius: 4px;
    background-color: var(--bg-color);
    border: 3px solid transparent;
    background-clip: padding-box;
}

.dev-details::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 4px;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 215, 0, 0.15) 0px,
        rgba(255, 215, 0, 0.15) 10px,
        rgba(26, 26, 26, 0.3) 10px,
        rgba(26, 26, 26, 0.3) 20px
    );
    z-index: -1;
    pointer-events: none;
}


/* Dev summary стиль */
.dev-summary {
    position: relative;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    background-color: transparent;
    border: none;
    border-radius: 4px;
    user-select: none;
    font-size: 0.8em;
    color: var(--text-color);
    margin: 0;
}

/* Dev content - внутренний контейнер спойлера */
.dev-content {
    position: relative;
    margin-top: 0;
    padding: 1rem;
    border-radius: 0 0 4px 4px;
    background-color: transparent;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.step-header input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.step-header label {
    flex-grow: 1;
    margin: 0;
    font-weight: 400;
    cursor: pointer;
}

.step-button {
    width: auto;
    min-width: 7rem;
    margin: 0;
    padding: 5px 15px;
}

.step-progress {
    margin: 0.5rem 0 0 0;
    width: 100%;
    height: 0.4rem;
}

.step-status {
    margin: 0.5rem 0 0 0;
    padding: 5px;
    font-size: x-small;
    color: var(--text-color);
    min-height: 1.5rem;
}

.step-status.connected {
    color: #6abf69;
    font-weight: 400;
}

.step-status.error {
    color: #ff6b6b;
}

.step-status.ready {
    color: var(--text-color);
}
