* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #667eea;
}

.exercises-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    margin: 2rem 0;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.exercises-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-container {
    position: relative;
    max-width: 500px;
    margin: 2rem auto;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 5px 30px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.filter-tab {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

.filter-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.filter-tab.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.exercise-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.exercise-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.exercise-card:hover::before {
    left: 100%;
}

.exercise-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.exercise-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.exercise-number {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.exercise-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
    flex: 1;
    margin-left: 1rem;
}

.exercise-description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.exercise-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.category-tag {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    color: #666;
    padding: 0.4rem 1rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 2% auto;
    width: 90%;
    max-width: 900px;
    border-radius: 20px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2rem;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.8rem;
    margin: 0;
}

.close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

.modal-difficulty {
    margin: 0.5rem 0;
    font-weight: bold;
    font-size: 1rem;
}

.difficulty-label {
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    margin-left: 0.5rem;
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 15px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.tab {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
    font-size: 1rem;
}

.tab:hover {
    background: rgba(102, 126, 234, 0.1);
}

.tab.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.code-block {
    background: linear-gradient(135deg, #1e1e1e, #2d2d2d);
    color: #f8f8f2;
    padding: 2rem;
    border-radius: 15px;
    margin: 1rem 0;
    overflow-x: auto;
    font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
}

.code-block .keyword { color: #ff79c6; }
.code-block .string { color: #f1fa8c; }
.code-block .comment { color: #6272a4; }
.code-block .number { color: #bd93f9; }

.tab-content h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.tab-content h4 {
    color: #555;
    margin: 1rem 0 0.5rem 0;
}

.tab-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.tab-content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.tab-content li {
    margin-bottom: 0.5rem;
}

.tab-content pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    overflow-x: auto;
}

.copy-button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 50px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    display: inline-block;
}

.copy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    backdrop-filter: blur(10px);
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: white;
    font-size: 1.2rem;
    grid-column: 1 / -1;
}

.no-results h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.category-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 15px;
}

.category-section h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

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

.exercise-list li {
    margin: 5px 0;
}

.exercise-list a {
    text-decoration: none;
    color: #007bff;
}

.exercise-list a:hover {
    text-decoration: underline;
}

.modal-body pre code {
    display: block;
    background: #1e1e1e;
    color: #fff;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .exercises-grid { 
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .header-content { 
        flex-direction: column; 
        gap: 1rem; 
    }
    
    .filter-tabs { 
        flex-direction: column; 
        align-items: center; 
    }
    
    .modal-content { 
        width: 95%; 
        margin: 5% auto; 
    }
    
    .exercise-card {
        padding: 1.5rem;
    }
    
    .exercises-header h1 {
        font-size: 2rem;
    }
    
    .modal-header {
        padding: 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        padding: 0.8rem 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .exercise-card {
        padding: 1rem;
    }
    
    .exercise-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .exercise-title {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .exercise-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}