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

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

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

h1 {
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-left: 4px solid #667eea;
    border-radius: 5px;
}

.section h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.section p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.section .note {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    padding: 12px;
    margin-bottom: 15px;
    color: #856404;
    line-height: 1.6;
}

.section ol, .section ul {
    margin-left: 20px;
    color: #555;
    line-height: 1.8;
}

.section li {
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.file-input {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.file-input:hover {
    border-color: #667eea;
}

.file-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #764ba2;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #663a8a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    margin-top: 15px;
}

.status-message {
    padding: 15px;
    margin-top: 15px;
    border-radius: 5px;
    font-weight: 500;
    text-align: center;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.info-section {
    background-color: #f0f4ff;
    border-left-color: #764ba2;
}

.info-section h3 {
    color: #764ba2;
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.btn-danger:active:not(:disabled) {
    transform: translateY(0);
}

/* Key History Section */
.key-history-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #f0f4ff;
    border-left: 4px solid #764ba2;
    border-radius: 5px;
}

.key-history-header {
    margin-bottom: 15px;
}

.key-history-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 8px 12px;
    font-size: 1em;
    font-weight: 600;
    color: #764ba2;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 5px;
}

.key-history-toggle-btn:hover {
    background-color: rgba(118, 75, 162, 0.1);
}

.key-history-toggle-btn:active {
    background-color: rgba(118, 75, 162, 0.15);
}

.key-history-toggle-btn .toggle-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
    font-weight: bold;
}

.key-history-toggle-btn.expanded .toggle-arrow {
    transform: rotate(0deg);
}

.key-count {
    font-weight: 600;
    color: #667eea;
}

.key-history-content {
    margin-top: 15px;
}

.key-history-section h3 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.key-history-list {
    margin: 15px 0;
}

.key-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 10px;
}

.key-history-info {
    flex: 1;
}

.key-history-date {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.key-history-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.key-history-buttons .btn {
    padding: 8px 12px;
    font-size: 0.85em;
    margin: 0;
}

@media (max-width: 768px) {
    .key-history-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .key-history-buttons {
        width: 100%;
        margin-top: 10px;
    }

    .key-history-buttons .btn {
        flex: 1;
        min-width: 100px;
    }
}
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .section {
        padding: 15px;
    }

    .btn {
        width: 100%;
        margin-right: 0;
    }

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