/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

:root {
    --bg-color: #000;
    --text-color: #fff;
    --secondary-text: #888;
    --accent-color: #6c63ff;
    --border-color: #222;
    /* Темная тема: белые кнопки с черным текстом */
    --button-bg: #ffffff;
    --button-text: #000000;
    --button-border: #ffffff;
    --button-hover-bg: #6c63ff;
    --button-active-bg: #6c63ff;
    --button-active-text: #ffffff;
}

.light-theme {
    --bg-color: #f5f5f7;
    --text-color: #1d1d1f;
    --secondary-text: #86868b;
    --accent-color: #007aff;
    --border-color: #d2d2d7;
    /* Светлая тема: черные кнопки с белым текстом */
    --button-bg: #1d1d1f;
    --button-text: #ffffff;
    --button-border: #1d1d1f;
    --button-hover-bg: #007aff;
    --button-active-bg: #007aff;
    --button-active-text: #ffffff;
}

body {
    font-family: 'Fira Code', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    transition: opacity 0.5s;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-gif {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.loading-gif .tenor-gif-embed {
    width: 100%;
    height: 100%;
}

.loading-text {
    color: var(--text-color);
    font-size: 1.1rem;
}

/* Main Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1;
    opacity: 0;
    transition: opacity 0.5s;
    display: none;
}

.container.loaded {
    opacity: 1;
    display: block;
}

/* Header */
header {
    padding: 40px 0 20px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.controls {
    position: absolute;
    top: 20px;
    right: 0;
    display: flex;
    gap: 15px;
    align-items: center;
}

.control-btn {
    background: var(--button-bg);
    border: 1px solid var(--button-border);
    color: var(--button-text);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    transition: all 0.3s;
    font-weight: 500;
}

.control-btn:hover {
    background-color: var(--button-hover-bg);
    color: var(--button-active-text);
    transform: translateY(-1px);
}

.control-btn.active {
    background-color: var(--button-active-bg);
    color: var(--button-active-text);
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

.light-theme .control-btn.active {
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.header-line {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.prompt {
    color: var(--text-color);
    margin-right: 10px;
}

.user {
    color: var(--text-color);
    font-weight: 600;
}

.command {
    color: var(--text-color);
    margin-left: 10px;
}

/* Уменьшенный заголовок */
h1 {
    font-size: 1.8rem;
    margin: 15px 0 8px;
    color: var(--text-color);
    line-height: 1.3;
}

.subtitle {
    color: var(--secondary-text);
    font-size: 1rem;
    margin-bottom: 25px;
}

/* Main content */
main {
    padding: 30px 0;
}

section {
    margin-bottom: 40px;
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

h2::before {
    content: '>';
    margin-right: 10px;
    color: var(--text-color);
}

p {
    margin-bottom: 12px;
    font-size: 1rem;
    color: var(--text-color);
}

.gray-text {
    color: var(--secondary-text);
}

ul {
    list-style-type: none;
    padding-left: 0;
}

li {
    margin-bottom: 8px;
    color: var(--text-color);
    padding-left: 20px;
    position: relative;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

li::before {
    content: '-';
    position: absolute;
    left: 0;
    color: var(--text-color);
}

/* GIF Styling */
.gif-container {
    display: inline-block;
    margin: 0 10px;
    vertical-align: middle;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}

.gif-small {
    width: 24px;
    height: 24px;
}

.gif-medium {
    width: 100px;
    height: 100px;
}

.gif-container .tenor-gif-embed {
    width: 100%;
    height: 100%;
    border: none;
}

/* Projects section with GIF */
.projects-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

/* Cats section with GIF */
.cats-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 15px 0;
}

/* Adapter section */
.adapter-section {
    margin: 40px 0;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    background-color: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.3s;
}

.adapter-section:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

.adapter-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.adapter-text {
    font-size: 1rem;
    color: var(--secondary-text);
}

/* Adapter Grid Styles */
.adapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 40px 0;
    max-width: 800px;
    width: 100%;
}

.adapter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
}

.adapter-item:hover {
    transform: translateY(-5px);
}

.adapter-image {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: block;
}

.adapter-item:hover .adapter-image {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.adapter-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.adapter-item:hover .adapter-image img {
    transform: scale(1.1);
}

.adapter-label {
    margin-top: 15px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.adapter-item:hover .adapter-label {
    color: var(--accent-color);
}

.adapter-description {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--secondary-text);
    line-height: 1.4;
    max-width: 160px;
}

/* Adapter Page */
.adapter-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 20px;
}

.adapter-page-content {
    max-width: 600px;
    width: 100%;
}

.adapter-page-header {
    margin-bottom: 30px;
}

.adapter-page-title {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 8px;
}

.adapter-page-subtitle {
    color: var(--secondary-text);
    font-size: 1.1rem;
}

.back-btn {
    margin-top: 30px;
    padding: 10px 25px;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--button-border);
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    transition: all 0.3s;
    font-weight: 500;
}

.back-btn:hover {
    background-color: var(--button-hover-bg);
    color: var(--button-active-text);
    transform: translateY(-2px);
}

/* GitHub Widget */
.github-section {
    margin: 30px 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.02);
}

.github-widget-container {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.github-placeholder {
    padding: 15px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--secondary-text);
    font-size: 0.9rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 25px 0;
    border-top: 1px solid var(--border-color);
    color: var(--secondary-text);
    font-size: 0.85rem;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

footer p {
    margin-bottom: 0;
    color: var(--secondary-text);
}

/* IP Display Styles */
.ip-display {
    color: var(--secondary-text);
    font-size: 0.8rem;
    margin-top: 5px;
}

#userIP {
    color: var(--secondary-text);
    font-weight: 600;
    font-family: 'Fira Code', monospace;
}

/* Section separator */
.section-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 25px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.1rem;
    }
    
    p, li {
        font-size: 0.9rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .controls {
        position: static;
        justify-content: flex-end;
        margin-bottom: 15px;
    }
    
    .cats-section, .projects-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .adapter-content {
        flex-direction: column;
    }
    
    .adapter-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 25px;
        margin: 30px 0;
    }
    
    .adapter-image {
        width: 120px;
        height: 120px;
    }
    
    .adapter-label {
        font-size: 1rem;
        margin-top: 12px;
    }
    
    .adapter-description {
        font-size: 0.85rem;
        max-width: 140px;
    }
    
    .adapter-page-title {
        font-size: 1.7rem;
    }
    
    .loading-gif {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.3rem;
    }
    
    h2 {
        font-size: 1rem;
    }
    
    .controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .gif-medium {
        width: 80px;
        height: 80px;
    }
    
    .adapter-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        max-width: 300px;
    }
    
    .adapter-item {
        padding: 0 10px;
    }
    
    .adapter-image {
        width: 140px;
        height: 140px;
    }
    
    .adapter-label {
        font-size: 1.1rem;
    }
    
    .adapter-description {
        font-size: 0.9rem;
        max-width: 200px;
    }
    
    .adapter-page-title {
        font-size: 1.5rem;
    }
    
    .loading-gif {
        width: 100px;
        height: 100px;
    }
    
    footer {
        font-size: 0.75rem;
        padding: 20px 0;
    }
    
    .ip-display {
        font-size: 0.7rem;
    }
}

@media (max-width: 360px) {
    .adapter-grid {
        gap: 25px;
    }
    
    .adapter-image {
        width: 120px;
        height: 120px;
    }
    }
