:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.site-header {
    background-color: #1e293b;
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    margin-bottom: 2rem;
}

.site-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.site-header p {
    color: #94a3b8;
    font-size: 1rem;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    width: 100%;
    flex: 1;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-3px);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #f9fafb;
}

.card-header h3 {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.card-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

/* Inputs and Buttons */
input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--primary-hover);
}

button:active {
    transform: scale(0.98);
}

/* Result Area */
.result-box {
    padding: 1rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
}

.result-box.error {
    color: var(--error-color);
    background-color: #fef2f2;
    border-color: #fecaca;
}

.result-box.success {
    color: var(--success-color);
    background-color: #ecfdf5;
    border-color: #a7f3d0;
}

/* History Section */
.history-section {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.history-section h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-list {
    list-style: none;
    max-height: 100px;
    overflow-y: auto;
}

.history-list li {
    font-size: 0.875rem;
    padding: 0.25rem 0;
    color: var(--text-muted);
    border-bottom: 1px dotted var(--border-color);
}

.history-list li:last-child {
    border-bottom: none;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 2rem;
}

/* Responsive Adjustment */
@media (max-width: 600px) {
    .site-header h1 {
        font-size: 1.5rem;
    }
    
    .container {
        grid-template-columns: 1fr;
    }
}