/* Глобальные переменные и базовые стили */
:root {
    --primary-gradient: linear-gradient(135deg, #33485dff, #3498db);
    --success-gradient: linear-gradient(135deg, #2e885eff 0%, #157347 100%);
    --warning-gradient: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%);
    --oranje-gradient: linear-gradient(135deg, #f9aa6aff 0%, #fd7f24ff 100%);
    --info-gradient: linear-gradient(135deg, #42d3f0ff 0%, #26b5d2ff 100%);
    --light-bg: linear-gradient(135deg, #f8f9fa 0%, #cfd3d6ff 100%);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
}

body {
    background: var(--light-bg);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

.main-container {
    min-height: 100vh;
    padding: 20px 0;
}

.header-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-title img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
}

.help-btn {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    font-size: 2.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 6px 15px rgba(0,0,0,0.1),
        inset 0 2px 4px rgba(255,255,255,0.8),
        inset 0 -4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    border: 3px solid rgba(255,255,255,0.8);
    background: var(--primary-gradient);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    color: white !important;
}

.help-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 10px 25px rgba(0,0,0,0.15),
        inset 0 2px 4px rgba(255,255,255,0.9),
        inset 0 -4px 8px rgba(0,0,0,0.15);
    color: white;
}

.help-btn:active {
    transform: translateY(-2px);
}

.help-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.help-btn:hover::before {
    left: 100%;
}

.help-label {
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6c757d;
    text-align: center;
}

.app-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    text-decoration: none;
    color: inherit;
    display: block;
    box-shadow: var(--card-shadow);
    position: relative;
}

.app-card:hover {
    transform: translateY(-5px);
    border-color: rgba(13, 110, 253, 0.3);
    box-shadow: var(--card-shadow-hover);
    text-decoration: none;
    color: inherit;
}

/* Стили для активных карточек */
.app-card.active {
    background: linear-gradient(135deg, 
        #33485dff 0%, 
        #2c3e50 25%,
        #3498db 50%,
        #2980b9 75%,
        #374e64ff 100%
    );
    background-size: 200% 200%;
    border-color: rgba(13, 110, 253, 0.3);
    color: white;
    position: relative;
    overflow: hidden;   
}

.app-card.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.7s ease;
}
.app-card.active:hover::before {
    left: 100%;
}

.app-card.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.7) 50%,
        rgba(255,255,255,0) 100%
    );
    border-radius: 15px 15px 0 0;
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

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

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.app-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.app-card.active .card-icon {
    animation: iconGlow 2s ease-in-out infinite alternate;
}

@keyframes iconGlow {
    from { filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5)); }
    to { filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8)); }
}

.app-card .card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: inherit;
}

.app-card .card-text {
    color: #6c757d;
    line-height: 1.5;
    font-size: 0.95rem;
}

.app-card.active .card-text {
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 1;
}

.app-card.active .card-title {
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.coming-soon {
    position: relative;
    opacity: 0.8;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.coming-soon::after {
    content: 'СКОРО';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--warning-gradient);
    color: #000;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.coming-soon:hover {
    transform: none;
    box-shadow: var(--card-shadow);
    cursor: not-allowed;
}

/* Цвета иконок для светлой темы */
.app-card:not(.active) .card-icon.text-info { color: #0dbbf0ff !important; }
.app-card:not(.active) .card-icon.text-success { color: #31a317ff !important; }
.app-card:not(.active) .card-icon.text-warning { color: #ffc107 !important; }
.app-card:not(.active) .card-icon.text-primary { color: #0d6efd !important; }
.app-card:not(.active) .card-icon.text-oranje { color: #d67562ff !important; }

/* Модальное окно */
.help-modal .modal-content {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.help-modal .modal-header {
    border-bottom: 1px solid #dee2e6;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px 15px 0 0;
}

.help-modal .modal-body {
    padding: 0;
    border-radius: 0 0 15px 15px;
    overflow: hidden;
}

.help-modal iframe {
    width: 100%;
    height: 60vh;
    border: none;
    background: white;
}

/* Адаптивность */
@media (max-width: 768px) {
    .main-container { padding: 15px 0; }
    .header-section { padding: 20px; margin-bottom: 20px; }
    .logo-title { flex-direction: column; text-align: center; gap: 10px; }
    .logo-title img { width: 50px; height: 50px; }
    .help-btn { width: 70px; height: 70px; font-size: 2rem; }
    .app-card { padding: 20px; }
    .app-card .card-icon { font-size: 2rem; }
    .app-card .card-title { font-size: 1.1rem; }
    .help-modal iframe { height: 50vh; }
}

@media (max-width: 576px) {
    .header-section { padding: 15px; }
    .app-card { padding: 15px; margin-bottom: 15px; }
    .help-btn { width: 60px; height: 60px; font-size: 1.8rem; }
    .help-label { font-size: 0.8rem; }
}

@media (max-width: 360px) {
    .logo-title h1 { font-size: 1.5rem; }
    .logo-title .lead { font-size: 0.9rem; }
    .app-card .card-title { font-size: 1rem; }
    .app-card .card-text { font-size: 0.85rem; }
}

/* Эффект пульсации */
@keyframes pulseAttention {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4), var(--card-shadow-hover); }
    70% { box-shadow: 0 0 0 15px rgba(52, 152, 219, 0), var(--card-shadow-hover); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0), var(--card-shadow-hover); }
}

.attention-pulse {
    animation: pulseAttention 2s ease infinite;
}

.text-muted-light { color: #6c757d !important; }
.border-light-custom { border-color: rgba(0, 0, 0, 0.05) !important; }
h1, h2, h3, h4, h5, h6 { color: #212529; }
.lead { color: #495057; }
