/* Passkey Authentication - Main Styles */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

a, a:visited {
    text-decoration: none;
}

.container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    font-weight: 300;
    font-size: 28px;
}

h2 {
    color: #555;
    margin-bottom: 20px;
    font-weight: 400;
    font-size: 22px;
}

input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

button {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.btn-secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

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

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

button:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.status {
    padding: 10px;
    margin: 15px 0;
    border-radius: 5px;
    font-size: 14px;
}

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

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

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

.credential-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 20px 0;
}

.credential-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    text-align: left;
}

.credential-item.current-session {
    border: 2px solid #007bff;
    background: #f8f9ff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.credential-item.current-session .credential-info h4 {
    color: #0056b3;
}

.credential-header {
    display: grid;
    grid-template-columns: 32px 1fr auto auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.credential-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-icon {
    border-radius: 4px;
    width: 32px;
    height: 32px;
}

.auth-emoji {
    font-size: 24px;
    display: block;
    text-align: center;
}

.credential-info {
    min-width: 0;
}

.credential-info h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.credential-dates {
    text-align: right;
    flex-shrink: 0;
    margin-left: 20px;
    display: grid;
    grid-template-columns: auto auto;
    gap: 5px 10px;
    align-items: center;
}

.date-label {
    color: #666;
    font-weight: normal;
    font-size: 12px;
    text-align: right;
}

.date-value {
    color: #333;
    font-size: 12px;
    text-align: left;
}

.user-info {
    background: #e7f3ff;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.user-info h3 {
    margin: 0 0 10px 0;
    color: #0c5460;
}

.user-info p {
    margin: 5px 0;
    color: #0c5460;
}

.toggle-link {
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
}

.toggle-link:hover {
    color: #764ba2;
}

.hidden {
    display: none;
}

.credential-actions {
    display: flex;
    align-items: center;
}

.btn-delete-credential {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    color: #dc3545;
    transition: background-color 0.2s;
}

.btn-delete-credential:hover:not(:disabled) {
    background-color: #f8d7da;
}

.btn-delete-credential:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.token-info {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: left;
}

.token-info strong {
    color: #333;
}

.token-info code {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.qr-code {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: white;
    margin: 10px 0;
}

.link-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    word-break: break-all;
}

.link-container .link-text {
    font-family: monospace;
    font-size: 14px;
    color: #495057;
    margin: 0;
}

/* Global Status Styles */
.global-status {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    min-width: 300px;
    max-width: 600px;
    display: none;
    animation: slideDown 0.3s ease-out;
}

.global-status .status {
    margin: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-width: 2px;
    font-weight: 500;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
}

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

.status.success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

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

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Vue-specific styles */
[v-cloak] {
    display: none;
}

/* Dialog overlay and modal styles */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.device-dialog {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: none;
    animation: slideUp 0.3s ease-out;
}

.device-link-section {
    margin: 20px 0;
}

.token-info {
    text-align: center;
}

.token-display {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.token-display code {
    font-size: 16px;
    font-weight: bold;
    color: #495057;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

    .device-dialog {
        margin: 20px;
        padding: 20px;
        max-width: none;
    }

    .global-status {
        left: 20px;
        right: 20px;
        transform: none;
        min-width: auto;
    }

    .credential-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .credential-dates {
        width: 100%;
    }
}
