* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #434343 0%, #2d2d2d 50%, #1a1a1a 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 40px 20px;
    color: #e8e8ea;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(80, 80, 80, 0.3), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(60, 60, 60, 0.3), transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(90, 90, 90, 0.3), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 60px;
    padding: 40px 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 3rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: -1px;
    color: white;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    padding: 0;
    max-width: 1400px;
    margin: 0 auto;
}

.project-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.project-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    cursor: grabbing;
}

.project-card.drag-over {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6b7280, #9ca3af, #d1d5db);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::before {
    opacity: 1;
}

/* Ручка для перетаскивания */
.drag-handle {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.4);
    cursor: grab;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    z-index: 10;
    line-height: 1;
}

.drag-handle:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Индикатор статуса */
.status-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 10;
    transition: all 0.3s ease;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

/* Статус: Проверка */
.status-indicator[data-status="checking"] .status-dot {
    background: #9ca3af;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Статус: Онлайн */
.status-indicator[data-status="online"] {
    background: rgba(34, 197, 94, 0.2);
}

.status-indicator[data-status="online"] .status-dot {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.status-indicator[data-status="online"]::after {
    content: 'Online';
    color: #22c55e;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Статус: Офлайн */
.status-indicator[data-status="offline"] {
    background: rgba(239, 68, 68, 0.2);
}

.status-indicator[data-status="offline"] .status-dot {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.status-indicator[data-status="offline"]::after {
    content: 'Offline';
    color: #ef4444;
    font-size: 0.7rem;
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

.project-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.project-card:hover .project-icon {
    transform: scale(1.1) rotate(5deg);
}

.project-card h2 {
    color: white;
    font-size: 1.6rem;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.project-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    margin-bottom: 28px;
    line-height: 1.6;
}

.project-button {
    display: inline-block;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(229, 231, 235, 0.8));
    color: #1f2937;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    letter-spacing: -0.2px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.project-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.5s ease;
}

.project-button:hover::before {
    left: 100%;
}

.project-button:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(243, 244, 246, 0.9));
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.empty-state {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Кнопка настроек */
.settings-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px) rotate(90deg);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

/* Модальные окна */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: rgba(45, 45, 45, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: modalSlideIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 10px;
    line-height: 1;
    transition: all 0.2s ease;
}

.close-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

/* Список проектов в настройках */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.projects-list .project-item {
    animation: slideInLeft 0.3s ease forwards;
    opacity: 0;
}

.projects-list .project-item:nth-child(1) { animation-delay: 0.05s; }
.projects-list .project-item:nth-child(2) { animation-delay: 0.1s; }
.projects-list .project-item:nth-child(3) { animation-delay: 0.15s; }
.projects-list .project-item:nth-child(4) { animation-delay: 0.2s; }
.projects-list .project-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.project-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.project-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.project-item-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.project-item-info {
    flex: 1;
    min-width: 0;
}

.project-item-name {
    font-weight: 600;
    font-size: 1rem;
    color: white;
    margin-bottom: 4px;
}

.project-item-url {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-item-actions {
    display: flex;
    gap: 8px;
}

/* Формы */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transition: all 0.2s ease;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

/* Кнопки */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: -0.2px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(229, 231, 235, 0.8));
    color: #1f2937;
    flex: 1;
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(243, 244, 246, 0.9));
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.btn-danger:hover {
    background: rgba(220, 38, 38, 0.95);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Адаптация для планшетов */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }

    header {
        padding: 30px 20px;
        margin-bottom: 40px;
    }

    header h1 {
        font-size: 2.5rem;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    body {
        padding: 15px 10px;
    }

    .container {
        padding: 10px;
    }

    header {
        padding: 25px 15px;
        margin-bottom: 30px;
        border-radius: 16px;
    }

    header h1 {
        font-size: 1.8rem;
        letter-spacing: -0.5px;
    }

    .settings-btn {
        padding: 10px 12px;
        font-size: 1.2rem;
        border-radius: 10px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .project-card {
        padding: 30px 20px;
        border-radius: 16px;
    }

    .project-card:hover {
        transform: translateY(-4px) scale(1.01);
    }

    .project-icon {
        font-size: 3rem;
        margin-bottom: 15px;
    }

    .project-card h2 {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }

    .project-description {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .project-button {
        padding: 12px 24px;
        font-size: 0.95rem;
        border-radius: 40px;
    }

    /* Индикатор статуса */
    .status-indicator {
        padding: 5px 8px;
        font-size: 0.7rem;
    }

    .status-dot {
        width: 7px;
        height: 7px;
    }

    /* Ручка перетаскивания */
    .drag-handle {
        font-size: 1rem;
        padding: 6px 10px;
    }

    /* Модальные окна */
    .modal {
        padding: 15px;
    }

    .modal-content {
        max-width: 100%;
        border-radius: 20px;
        max-height: 85vh;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .modal-body {
        padding: 20px;
    }

    .close-btn {
        font-size: 1.3rem;
        padding: 3px 8px;
    }

    /* Список проектов в настройках */
    .project-item {
        flex-wrap: wrap;
        padding: 12px;
        gap: 10px;
    }

    .project-item-icon {
        font-size: 1.8rem;
    }

    .project-item-name {
        font-size: 0.95rem;
    }

    .project-item-url {
        font-size: 0.8rem;
    }

    .project-item-actions {
        width: 100%;
        justify-content: flex-end;
        gap: 6px;
    }

    /* Формы */
    .form-group {
        margin-bottom: 14px;
    }

    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }

    .form-group input {
        padding: 10px;
        font-size: 0.9rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 20px;
    }

    /* Кнопки */
    .btn {
        padding: 10px 18px;
        font-size: 0.9rem;
        width: 100%;
    }

    .btn-small {
        padding: 6px 10px;
        font-size: 0.8rem;
        width: auto;
    }

    .empty-state {
        padding: 30px 20px;
        font-size: 1rem;
        border-radius: 16px;
    }
}

/* Адаптация для очень маленьких экранов */
@media (max-width: 480px) {
    body {
        padding: 10px 8px;
    }

    header {
        padding: 20px 12px;
        margin-bottom: 20px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .settings-btn {
        padding: 8px 10px;
        font-size: 1.1rem;
    }

    .project-card {
        padding: 25px 15px;
    }

    .project-icon {
        font-size: 2.5rem;
    }

    .project-card h2 {
        font-size: 1.2rem;
    }

    .project-description {
        font-size: 0.9rem;
    }

    .project-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    .project-item {
        padding: 10px;
    }

    .project-item-icon {
        font-size: 1.5rem;
    }

    .project-item-actions {
        flex-direction: column;
        width: 100%;
    }

    .project-item-actions .btn-small {
        width: 100%;
    }
}
