/* GPG Webservice Dashboard Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 600px;
    width: 100%;
}

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

.header h1 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: monospace;
    font-size: 0.85rem;
}

/* Small monospace textarea used for tokens and short PGP blobs */
.monospace-textarea {
    font-family: monospace;
    font-size: 0.9rem;
    padding: 8px 10px;
}

/* Small utility class for logout spacing */
.logout-btn {
    margin-left: 10px;
}

.form-group input[type="file"] {
    display: none;
}

.file-upload-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-btn:hover {
    background: #e8e8e8;
    border-color: #999;
}

.file-upload-btn.has-file {
    background: #e6ffe6;
    border-color: #4caf50;
    border-style: solid;
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    background: #6c757d;
}

.btn-danger {
    background: #dc3545;
}

.btn-success {
    background: #28a745;
}

.link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
}

.link:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

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

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

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

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

.profile-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.profile-section h2 {
    color: #667eea;
    font-size: 1.3rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e1e8ed;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e1e8ed;
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field label {
    font-weight: 600;
    color: #555;
}

.profile-field span {
    color: #333;
    font-family: monospace;
}

.api-key-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-key-display input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
    width: auto;
    margin: 0;
}

.key-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.key-actions button {
    flex: 1;
}

.hidden {
    display: none;
}

.optional-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.optional-section h3 {
    color: #667eea;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
}

.nav-links a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-links a:hover {
    text-decoration: underline;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

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

    .key-actions {
        flex-direction: column;
    }
}

/* Security warnings */
.security-warning {
    display: flex;
    align-items: start;
    gap: 10px;
    padding: 12px 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    margin-bottom: 15px;
}

.security-warning::before {
    content: "⚠️";
    font-size: 1.2rem;
}

.security-warning p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
}

/* Admin page styles */
.admin-section {
    margin: 20px 0;
}

.user-list {
    margin-top: 15px;
}

.user-list table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.user-list table th,
.user-list table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.user-list table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.user-list table code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
    resize: vertical;
}

textarea:focus {
    border-color: #0070f3;
    outline: none;
}

