/* components.css - Компоненты интерфейса */

/* ===== КНОПКИ ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.btn:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.25);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* Размеры кнопок */
.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
}

/* Стили кнопок */
.btn-primary {
    background: linear-gradient(135deg, #3f51b5 0%, #283593 100%);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #283593 0%, #1a237e 100%);
    box-shadow: 0 4px 12px rgba(63, 81, 181, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #388e3c 0%, #2e7d32 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f57c00 0%, #ef6c00 100%);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.btn-outline-primary {
    background: transparent;
    color: #3f51b5;
    border: 2px solid #3f51b5;
}

.btn-outline-primary:hover {
    background: #3f51b5;
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    color: #2196f3;
    border: 2px solid #2196f3;
}

.btn-outline-secondary:hover {
    background: #2196f3;
    color: white;
}

/* Кнопка с иконкой */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

.btn-icon-lg {
    width: 50px;
    height: 50px;
}

.btn-icon-sm {
    width: 30px;
    height: 30px;
}

/* Группа кнопок */
.btn-group {
    display: inline-flex;
    gap: 10px;
}

.btn-group .btn {
    border-radius: 6px;
}

.btn-group .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.btn-group .btn:not(:first-child):not(:last-child) {
    border-radius: 0;
}

/* ===== КАРТОЧКИ ===== */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card-header {
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    border-bottom: 1px solid #eaeaea;
}

.card-header h3 {
    margin: 0;
    color: #1a237e;
    font-size: 1.25rem;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eaeaea;
}

/* Карточка с иконкой */
.card-icon {
    text-align: center;
    padding: 30px 20px;
}

.card-icon .icon {
    margin: 0 auto 20px;
}

.card-icon h3 {
    margin-bottom: 10px;
}

.card-icon p {
    color: #666;
    font-size: 14px;
}

/* ===== ФОРМЫ ===== */
.form-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.form-card-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: white;
}

.form-card-header h2 {
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-card-body {
    padding: 30px;
}

/* Группы формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group label.required::after {
    content: " *";
    color: #f44336;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Поля с иконками */
.input-with-icon {
    position: relative;
}

.input-with-icon input,
.input-with-icon select,
.input-with-icon textarea {
    padding-left: 40px;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 16px;
}

/* Валидация */
.is-valid {
    border-color: #4caf50 !important;
}

.is-invalid {
    border-color: #f44336 !important;
}

.valid-feedback {
    display: none;
    color: #4caf50;
    font-size: 12px;
    margin-top: 5px;
}

.invalid-feedback {
    display: none;
    color: #f44336;
    font-size: 12px;
    margin-top: 5px;
}

.is-valid ~ .valid-feedback {
    display: block;
}

.is-invalid ~ .invalid-feedback {
    display: block;
}

/* ===== ТАБЛИЦЫ ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: white;
    font-weight: 600;
    text-align: left;
    padding: 15px;
    font-size: 14px;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eaeaea;
    color: #333;
    font-size: 14px;
}

.table tr:hover {
    background: #f9f9f9;
}

.table-striped tbody tr:nth-child(odd) {
    background: #f8f9fa;
}

.table-bordered {
    border: 1px solid #eaeaea;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #eaeaea;
}

/* ===== БЭДЖИ ===== */
.badge {
    display: inline-block;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 20px;
}

.badge-primary {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-secondary {
    background: #f5f5f5;
    color: #666;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

.badge-warning {
    background: #fff3e0;
    color: #ef6c00;
}

.badge-info {
    background: #e1f5fe;
    color: #0277bd;
}

/* ===== АЛЕРТЫ ===== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success {
    background: #e8f5e9;
    border-color: #c8e6c9;
    color: #2e7d32;
}

.alert-danger {
    background: #ffebee;
    border-color: #ffcdd2;
    color: #c62828;
}

.alert-warning {
    background: #fff3e0;
    border-color: #ffe0b2;
    color: #ef6c00;
}

.alert-info {
    background: #e1f5fe;
    border-color: #b3e5fc;
    color: #0277bd;
}

.alert-primary {
    background: #e3f2fd;
    border-color: #bbdefb;
    color: #1565c0;
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-dismissible {
    padding-right: 45px;
    position: relative;
}

.alert-dismissible .close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
}

.alert-dismissible .close:hover {
    opacity: 1;
}

/* ===== ЗАГРУЗКА ФАЙЛОВ ===== */
.file-upload {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.file-upload:hover {
    border-color: #3f51b5;
    background: #f0f2ff;
}

.file-upload i {
    font-size: 48px;
    color: #adb5bd;
    margin-bottom: 15px;
}

.file-upload p {
    color: #666;
    margin-bottom: 15px;
}

.file-upload input[type="file"] {
    display: none;
}

/* ===== СТЕППЕР ===== */
.stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.stepper::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #eaeaea;
    z-index: 1;
}

.step {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eaeaea;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: 600;
    transition: all 0.3s;
}

.step.active .step-circle {
    background: linear-gradient(135deg, #3f51b5 0%, #283593 100%);
    color: white;
    box-shadow: 0 0 0 5px rgba(63, 81, 181, 0.2);
}

.step.completed .step-circle {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
}

.step-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.step.active .step-label {
    color: #1a237e;
    font-weight: 600;
}

/* ===== ПРЕДПРОСМОТР ПРОПУСКА ===== */
.pass-preview {
    background: white;
    border-radius: 12px;
    padding: 30px;
    border: 2px dashed #eaeaea;
    margin-top: 30px;
}

.pass-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #1a237e;
}

.pass-header h3 {
    color: #1a237e;
    margin: 0;
}

.pass-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.pass-item {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.pass-label {
    font-weight: 600;
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
}

.pass-value {
    color: #333;
    font-size: 15px;
    font-weight: 500;
}

.pass-qr {
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-top: 20px;
}

.qr-placeholder {
    width: 150px;
    height: 150px;
    background: white;
    border: 2px dashed #ccc;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
    text-align: center;
    line-height: 1.4;
}

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.breadcrumbs {
    margin-bottom: 20px;
    padding: 10px 0;
    background: #f8f9fa;
    border-radius: 6px;
}

.breadcrumbs ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumbs li {
    margin-right: 10px;
    display: flex;
    align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
    content: '›';
    margin-left: 10px;
    color: #666;
}

.breadcrumbs a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: #1a237e;
}

.breadcrumbs span {
    color: #1a237e;
    font-weight: 500;
}

/* ===== ИНФО-БЛОКИ ===== */
.info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px 20px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 20px;
}

.info-box h4 {
    color: #0d47a1;
    margin: 0 0 5px 0;
    font-size: 16px;
}

.info-box p {
    color: #1565c0;
    margin: 0;
    font-size: 14px;
}

.warning-box {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 15px 20px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 20px;
}

.warning-box h4 {
    color: #ef6c00;
    margin: 0 0 5px 0;
    font-size: 16px;
}

.warning-box p {
    color: #f57c00;
    margin: 0;
    font-size: 14px;
}

.success-box {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    padding: 15px 20px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 20px;
}

.success-box h4 {
    color: #2e7d32;
    margin: 0 0 5px 0;
    font-size: 16px;
}

.success-box p {
    color: #388e3c;
    margin: 0;
    font-size: 14px;
}