:root {
    --primary-color: #4e3ab4;
    --secondary-color: #6d6b29;
    --success-color: #28a745;
    --error-color: #dc3545;
}

body {
    background-color: var(--secondary-color);
    font-family: "Roboto", sans-serif;
    font-weight: 400;
    font-style: normal;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
}

.card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.card-header {
    text-align: center;
    margin-bottom: 20px;
}

.card-header h2 {
    margin: 0;
    color: #333333;
    font-size: 1.5em;
}

.card-header small {
    color: #777777;
    font-size: 0.9em;
}

hr {
    margin: 10px 0;
    border: none;
    border-top: 1px solid #afafaf;
}

canvas {
    width: 100%;
    max-width: 300px;
    height: auto;
    border: 2px solid #cccccc;
    border-radius: 4px;
    background-color: #000000;
    cursor: crosshair;
    touch-action: none;
    display: block;
    margin: 0 auto;
}

.card-body {
    margin-top: 20px;
}

.btn-group {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.btn-group button {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-group button:not(:last-child) {
    margin-right: 10px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    opacity: 0.8;
}

.btn-outline-primary {
    background-color: #ffffff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: #f0f0f0;
}

.list-group {
    margin-top: 20px;
}

.list-group-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid #eeeeee;
}

.list-group-item:last-child {
    border-bottom: none;
}

.result {
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
}

.result.success {
    color: var(--success-color);
    background-color: #e6f9ee;
}

.result.error {
    color: var(--error-color);
    background-color: #fdecea;
}

.card-footer {
    text-align: center;
    margin-top: 20px;
}

.card-footer a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 5px;
}

.card-footer a:hover {
    text-decoration: underline;
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite;
    margin-bottom: 10px;
}

.spinner-container p {
    margin-bottom: 0;
    font-size: 1em;
}

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

/* Responsive Design */

@media (max-width: 600px) {
    .card {
        padding: 15px;
    }

    .card-header h2 {
        font-size: 1.3em;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group button {
        font-size: 14px;
        padding: 10px;
    }

    .list-group-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .result {
        width: 100%;
        margin-top: 5px;
    }

    .result.success,
    .result.error {
        text-align: left;
    }

    .spinner {
        width: 50px;
        height: 50px;
        border-width: 6px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 10px;
    }

    .card-header h2 {
        font-size: 1.2em;
    }

    .btn-group button {
        font-size: 13px;
        padding: 8px;
    }

    .spinner {
        width: 40px;
        height: 40px;
        border-width: 5px;
    }
}

@media (min-width: 601px) {
    .btn-group {
        flex-direction: row;
    }

    .list-group-item {
        flex-direction: row;
        align-items: center;
    }

    .result {
        width: auto;
        margin-top: 0;
    }

    .result.success,
    .result.error {
        text-align: center;
    }
}
