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

body {
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

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

.header {
    color: black;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    text-align: right;
}

.font-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 30px;
}

.font-card {
    overflow: hidden;
    box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    user-select: none;
    border: 2px solid black;
}

.font-card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 0px 20px 5px rgba(0, 0, 0, 0.2);
}

.font-header {
    padding: 25px;
    border-bottom: 2px solid black;
    font-family: inherit;
}

.font-name {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-direction: row;
}

.font-name span {
    font-size: 0.8rem;
    border: 2px solid black;
    padding: 1px 6px;
    margin-left: 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.font-header:hover .font-name span {
    border-color: white;
    color: white;
}

.font-header:hover .font-name span:hover {
    background-color: white;
    color: black;
}

.font-meta {
    font-size: 0.9rem;
}

.font-preview {
    padding: 25px;
    height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-family: inherit;
    border-bottom: 2px solid black;
}

.font-actions {
    padding: 20px 25px;
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.font-actions > span {
    display: flex;
    gap: 12px;
}

.copy-btn {
    flex: 1;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-family: inherit;
    background: transparent;
    color: inherit;
    text-align: center;
    border: 2px solid black;
}

.font-name span:hover,
.copy-btn:hover {
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: translateY(0);
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: black;
    border: 2px solid black;
    padding: 12px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 1000;
}

.font-header,
.font-preview,
.copy-btn {
    background: white;
    color: black;
    transition: all 0.3s ease;
}

.font-header:hover,
.font-preview:hover,
.copy-btn:hover {
    background: black;
    color: white;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

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

    .header h1 {
        font-size: 2rem;
    }

    .font-actions > span {
        flex-direction: column;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background-color: transparent;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background-color: #000000;
    border: 2px solid white;
}

/* overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    /* dark semi-transparent */
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* visible state */
.loading-overlay.active {
    visibility: visible;
    opacity: 1;
}

/* spinner */
.spinner-wrapper {
    position: relative;
    width: 50px;
    /* match spinner size */
    height: 50px;
    margin-bottom: 15px;
}

/* shared spinner style */
.spinner1,
.spinner2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
}

/* spinner 1 */
.spinner1 {
    border: 4px solid black;
    animation: spin 2.2s ease infinite;
}

/* spinner 2 */
.spinner2 {
    border: 4px solid black;
    animation: spinReverse 3.5s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

@keyframes spinReverse {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

/* loading text */
.loading-text {
    color: black;
    font-size: 18px;
    font-weight: 500;
}
