* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    line-height: 1.6;
}

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

.decks-list {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.deck-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    width: 100%;
    margin-bottom: 40px;
}

.deck-item {
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px);
    color: white;
    border-radius: 20px;
    overflow: hidden;
    text-align: center;
    height: 280px;
    cursor: pointer;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.deck-item:hover {
    background-size: 105%;
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 60px rgba(79,70,229,0.3);
}

.deck-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.7) 100%);
    z-index: 1;
    transition: opacity 0.4s ease;
}

.deck-item:hover::before {
    background: linear-gradient(135deg, rgba(79,70,229,0.3) 0%, rgba(124,58,237,0.3) 100%);
}

.create-deck-item {
    backdrop-filter: blur(20px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.2);
    background-image: url('https://r2.spellbook.life/art/5676.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.create-deck-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.4);
    border-color: rgba(255,255,255,0.5);
}

.deck-info, .create-deck-info {
    position: absolute;
    bottom: 0;
    width: calc(100% - 32px);
    margin-bottom: 16px;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px;
}

.create-deck-info p{
    margin: 6px 0;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    transition: font-size 0.3s ease;
    font-size: 18px;
    line-height: 1.4;
}

.deck-item:hover .create-deck-info p {
    font-size: 20px;
}

.deck-info p {
    margin: 6px 0;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    transition: font-size 0.3s ease;
    font-size: 14px;
    line-height: 1.4;
}

.deck-item:hover .deck-info p {
    font-size: 16px;
}

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

.decks-list li {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    margin: 16px 0;
    padding: 20px;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.decks-list li a {
    color: white;
    text-decoration: none;
    display: block;
    font-weight: 500;
}

.decks-list li:hover {
    background: rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.2);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 32px 0;
}

.pagination-button {
    width: 50px;
    height: 40px;
    padding: 0;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    line-height: 40px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.pagination-button:hover:not(.disabled) {
    background: rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.2);
}

.pagination-button.disabled {
    background: rgba(255,255,255,0.05);
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-info {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    font-family: 'Inter', sans-serif;
}

.spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

h2 {
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin-top:0px;
}

#deck-search, #deck-search-by-card {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    width: 300px;
    min-width:300px;
    transition: all 0.3s ease;
}

#deck-search:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: rgba(255,255,255,0.08);
}

#deck-search::placeholder {
    color: rgba(255,255,255,0.6);
}

@media (max-width: 1200px) {
    .deck-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .deck-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .deck-item {
        height: 240px;
    }
    
    .container {
        padding: 20px 16px;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    #deck-search {
        width: 250px;
    }
}

@media (max-width: 600px) {
    .deck-grid {
        grid-template-columns: 1fr;
    }
    
}

@media (max-width: 650px){
    #deck-search, #deck-search-by-card {
        width: 250px;
        min-width:250px;
    }
}

@media (max-width: 525px){
    #deck-search, #deck-search-by-card {
        width: 200px;
        min-width:200px;
    }
}