/*
 * VD Portal - Optimized Two-Column Layout
 * Clean, modern design with responsive behavior
 */

/* Portal Wrapper */
.vd-portal-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Portal Header */
.vd-portal-header {
    text-align: center;
    margin-bottom: 30px;
}

.vd-portal-header h1 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 600;
}

.vd-portal-header p {
    color: #7f8c8d;
    font-size: 1.1em;
    margin: 0;
}

/* Two-Column Container - CRITICAL LAYOUT */
.vd-portal-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* LEFT PANEL - 60% Main Content */
.vd-portal-main {
    flex: 1 1 60%;
    max-width: 60%;
}

/* RIGHT SIDEBAR - 40% */
.vd-portal-sidebar {
    flex: 0 0 40%;
    max-width: 40%;
    position: sticky;
    top: 20px;
}

/* Card Component */
.vd-card {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease;
}

.vd-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.vd-card h2,
.vd-card h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.4em;
    font-weight: 600;
}

/* Form Styling */
.vd-form-group {
    margin-bottom: 20px;
}

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

.vd-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.vd-form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Button Styling */
.vd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 8px;
}

.vd-btn-primary {
    background: #3498db;
    color: white;
}

.vd-btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* Info Grid */
.vd-info-grid {
    display: grid;
    gap: 16px;
}

.vd-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.vd-info-item .label {
    font-weight: 500;
    color: #6c757d;
}

.vd-info-item .value {
    font-weight: 600;
    color: #2c3e50;
}

/* Simple Device Layout (Option 1) */
.vd-device-simple {
    margin-bottom: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #e1e8ed;
}

.vd-device-simple:last-child {
    border-bottom: none;
}

.vd-device-simple .device-header {
    font-weight: 600;
    font-size: 15px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.vd-device-simple .device-details {
    padding-left: 20px;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.8;
}

.vd-device-simple .device-details div {
    margin-bottom: 4px;
}

/* Device Status Icons */
.device-status-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    margin-right: 8px;
    line-height: 20px;
}

.device-status-text {
    margin-left: 6px;
    font-size: 13px;
    font-weight: 500;
}

/* Current Device Badge - Highlighted badge for the device currently being used */
.current-device-badge {
    display: inline-block;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 8px;
    margin-right: 4px;
    border: 1px solid #90caf9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(25, 118, 210, 0.15);
    transition: all 0.2s ease;
}

.current-device-badge:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(25, 118, 210, 0.25);
}

/* Active Device (Approved) - Green styling */
.device-active .device-header {
    color: #27ae60;
}

.device-active .device-status-icon {
    color: #27ae60;
}

.device-active .device-status-text {
    color: #27ae60;
}

/* Rejected Device - Red styling */
.device-rejected {
    opacity: 0.7;
}

.device-rejected .device-header {
    color: #e74c3c;
}

.device-rejected .device-status-icon {
    color: #e74c3c;
}

.device-rejected .device-status-text {
    color: #e74c3c;
}

.device-rejected .device-details {
    color: #95a5a6;
}

/* Simple History Layout (Option 1) */
.vd-history-simple {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.6;
}

.vd-history-simple:last-child {
    border-bottom: none;
}

/* History Status Icon */
.history-status-icon {
    display: inline-block;
    width: 20px;
    font-size: 14px;
    margin-right: 6px;
}

/* Option 2: Scroll for device/history lists */
#device-list,
#history-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px; /* Space for scrollbar */
}

/* Custom scrollbar for device/history lists */
#device-list::-webkit-scrollbar,
#history-list::-webkit-scrollbar {
    width: 8px;
}

#device-list::-webkit-scrollbar-track,
#history-list::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

#device-list::-webkit-scrollbar-thumb,
#history-list::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
    transition: background 0.2s ease;
}

#device-list::-webkit-scrollbar-thumb:hover,
#history-list::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Color coding for history entries (Option 2) */
.vd-history-simple.success {
    color: #27ae60;
}

.vd-history-simple.failed {
    color: #e74c3c;
}

.vd-history-simple.blocked {
    color: #e67e22;
}

/* Tabs Styling */
.vd-tabs {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.vd-tab-buttons {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e8ed;
}

.vd-tab-btn {
    flex: 1;
    padding: 16px 20px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vd-tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.vd-tab-btn.active {
    background: white;
    color: #3498db;
    border-bottom: 2px solid #3498db;
}

.vd-tab-content {
    display: none;
    padding: 20px;
}

.vd-tab-content.active {
    display: block;
}

.vd-tab-content .vd-card {
    margin: 0;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* Empty State */
.vd-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.vd-empty-state p {
    margin: 0;
    font-size: 1.1em;
}

/* Responsive Design - Enhanced Mobile UX */
@media (max-width: 768px) {
    .vd-portal-container {
        flex-direction: column;
        gap: 20px;
    }

    .vd-portal-main,
    .vd-portal-sidebar {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .vd-portal-sidebar {
        position: static;
        margin-top: 0 !important;
    }

    .vd-portal-wrapper {
        padding: 15px;
    }

    .vd-portal-header h1 {
        font-size: 2em;
    }

    /* ===========================
       MOBILE TAB CONSISTENCY FIX
       =========================== */

    /* Make sidebar tabs section look like credential cards */
    .vd-tabs {
        background: #ffffff !important;
        border: 1px solid #e1e8ed !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
        overflow: hidden;
        margin-bottom: 20px;
    }

    /* Tab header - match card styling */
    .vd-tab-buttons {
        background: #f8f9fa !important;
        border-bottom: 1px solid #e1e8ed !important;
        margin: 0;
        padding: 0;
        flex-direction: row;  /* Keep horizontal on mobile */
    }

    .vd-tab-btn {
        text-align: center;
        padding: 16px;  /* Larger touch targets */
        min-height: 56px;    /* Minimum 44px touch target */
        border: none;
        background: transparent;
        font-size: 14px;
        font-weight: 500;
        transition: all 0.2s ease;
    }

    .vd-tab-btn.active {
        background: #ffffff !important;
        color: #3498db !important;
        border-bottom: 2px solid #3498db !important;
    }

    /* Tab content - match card interior */
    .vd-tab-content {
        display: none;
        padding: 20px !important;
    }

    .vd-tab-content.active {
        display: block;
    }

    /* Remove nested card styling on mobile */
    .vd-tab-content .vd-card {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    /* Tab content headings */
    .vd-tab-content h3 {
        font-size: 1.2em !important;
        font-weight: 600 !important;
        margin-bottom: 16px !important;
        color: #2c3e50 !important;
    }

    /* Better spacing for credential fields on mobile */
    .vd-credential-value {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .vd-credential-value .value {
        margin-bottom: 0;
        font-size: 16px;  /* Prevent zoom on iOS */
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .vd-btn-copy {
        width: 100%;
        min-height: 44px;
        padding: 12px;
        font-size: 18px;
    }

    /* Larger form inputs for mobile */
    .vd-form-group input {
        font-size: 16px;  /* Prevent zoom on iOS */
        min-height: 44px;
        padding: 16px;
    }

    .vd-btn {
        min-height: 48px;
        padding: 14px 24px;
        font-size: 16px;
    }

    /* Better spacing for cards */
    .vd-card {
        padding: 20px;
        margin-bottom: 16px;
    }

    .vd-info-item {
        padding: 16px;
        margin-bottom: 8px;
    }

    /* Action buttons stack on mobile */
    .vd-actions {
        flex-direction: column;
        gap: 8px;
    }

    .vd-actions .vd-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .vd-portal-header h1 {
        font-size: 1.8em;
        margin-bottom: 8px;
    }

    .vd-portal-header p {
        font-size: 1em;
    }

    .vd-card {
        padding: 16px;
        margin-bottom: 12px;
    }

    .vd-card h2,
    .vd-card h3 {
        font-size: 1.2em;
        margin-bottom: 16px;
    }

    /* Keep minimum sizes for accessibility */
    .vd-form-group input {
        font-size: 16px;  /* Don't go below 16px on mobile */
        padding: 14px;
    }

    .vd-btn {
        padding: 12px 20px;
        font-size: 16px;  /* Keep readable size */
        min-height: 44px;
    }

    /* Credential fields on very small screens */
    .vd-credential-value .value {
        font-size: 14px;
        padding: 12px;
        line-height: 1.4;
        word-wrap: break-word;
        max-height: 7em;  /* Keep 5 lines limit on small screens */
        overflow-y: auto;
        white-space: pre-wrap;
    }

    .vd-btn-copy {
        font-size: 16px;
        padding: 10px;
    }

    /* Tighter spacing on small screens */
    .vd-portal-wrapper {
        padding: 12px;
    }

    .vd-info-item {
        padding: 12px;
    }

    .vd-tab-content {
        padding: 16px;
    }

    /* Stack tab buttons on very small screens */
    .vd-tab-buttons {
        flex-direction: column;
    }

    .vd-tab-btn {
        padding: 16px;
        width: 100%;
    }
}

/* Loading States */
.vd-loading {
    opacity: 0.6;
    pointer-events: none;
}

.vd-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Credential Fields with Copy Buttons */
.vd-credential-field {
    width: 100%;
}

.vd-credential-value {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.vd-credential-value .value {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
    word-break: break-all;
    /* Scroll for long content - max 5 lines */
    max-height: 7em;  /* ~5 lines of text at 14px font size */
    overflow-y: auto;
    white-space: pre-wrap;  /* Preserve line breaks */
    line-height: 1.4;
}

/* Notes field specific styling - Allow up to 20 lines with user-resizable option */
/* IMPORTANT: Only applies to 'notes' field, other fields keep 5-line limit */
.vd-credential-value .value.field-notes {
    max-height: 28em;   /* ~20 lines (1.4 line-height * 20 lines) */
    resize: vertical;    /* Allow user to manually resize vertically */
    min-height: 7em;     /* Minimum height same as default (5 lines) */
    overflow-y: auto;    /* Enable scrolling if content exceeds max-height */
}

/* Custom scrollbar for credential fields (Webkit browsers) */
.vd-credential-value .value::-webkit-scrollbar {
    width: 8px;
}

.vd-credential-value .value::-webkit-scrollbar-track {
    background: #e1e8ed;
    border-radius: 4px;
}

.vd-credential-value .value::-webkit-scrollbar-thumb {
    background: #95a5a6;
    border-radius: 4px;
}

.vd-credential-value .value::-webkit-scrollbar-thumb:hover {
    background: #7f8c8d;
}

.vd-btn-copy {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vd-btn-copy:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.vd-btn-copy.copied {
    background: #27ae60;
    transform: scale(1.1);
}

.vd-btn-copy.copy-error {
    background: #e74c3c;
    transform: scale(1.1);
}

/* Action Buttons */
.vd-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.vd-btn-secondary {
    background: #95a5a6;
    color: white;
}

.vd-btn-secondary:hover {
    background: #7f8c8d;
}

.vd-btn-outline {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.vd-btn-outline:hover {
    background: #3498db;
    color: white;
}

/* Success/Error States */
.vd-success {
    color: #27ae60;
    background: #d5f4e6;
    border: 1px solid #27ae60;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
}

.vd-error {
    color: #e74c3c;
    background: #fdf2f2;
    border: 1px solid #e74c3c;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
}

/* OPTION 1: Persistent Error (does not auto-hide) */
.vd-error-persistent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #e74c3c;
    background: #fdf2f2;
    border: 1px solid #e74c3c;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
}

.vd-error-message {
    flex: 1;
}

.vd-error-close {
    background: transparent;
    border: none;
    color: #e74c3c;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.vd-error-close:hover {
    background: rgba(231, 76, 60, 0.1);
    transform: scale(1.1);
}

.vd-error-close:active {
    transform: scale(0.95);
}

/* Tooltip Styling for Info Icons */
.vd-tooltip-icon {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    font-size: 16px;
    font-weight: bold;
    color: #3498db;
    cursor: help;
    margin-left: 8px;
    vertical-align: middle;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 20px;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.1);
    user-select: none;
}

.vd-tooltip-icon:hover {
    color: #2980b9;
    background: rgba(52, 152, 219, 0.2);
    transform: scale(1.1);
}

/* Tooltip bubble */
.vd-tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: 125%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    white-space: normal;
    width: 280px;
    max-width: 90vw;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    text-align: left;
}

/* Tooltip arrow */
.vd-tooltip-icon::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 115%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2c3e50;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Show tooltip on hover */
.vd-tooltip-icon:hover::after,
.vd-tooltip-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Mobile responsive tooltip */
@media (max-width: 768px) {
    .vd-tooltip-icon::after {
        width: 240px;
        font-size: 12px;
        padding: 10px 14px;
    }
}

/* Usage list styling */
.vd-usage-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vd-usage-list li {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e1e8ed;
}

.vd-usage-list li:last-child {
    border-bottom: none;
}

.vd-usage-list li strong {
    color: #6c757d;
    min-width: 140px;
    font-weight: 500;
}

.vd-usage-list li span:not(.dashicons) {
    color: #2c3e50;
    font-weight: 600;
}

/* ===========================
   INLINE DEVICE NAME EDIT
   =========================== */

/* Device name editable container */
.device-name-editable {
    display: inline;
    position: relative;
}

/* Device edit button */
.device-edit-btn {
    display: inline-block;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    margin-left: 6px;
    opacity: 0.6;
    transition: all 0.2s ease;
    border-radius: 4px;
    vertical-align: middle;
}

.device-edit-btn:hover {
    opacity: 1;
    background: rgba(52, 152, 219, 0.1);
    transform: scale(1.1);
}

.device-edit-btn:active {
    transform: scale(0.95);
}

/* Input field when editing */
.device-name-input {
    display: inline-block;
    width: auto;
    min-width: 150px;
    max-width: 300px;
    padding: 4px 8px;
    border: 2px solid #3498db;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transition: all 0.2s ease;
}

.device-name-input:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15);
}

/* Loading state */
.device-name-loading {
    color: #95a5a6;
    font-style: italic;
}

/* Success feedback animation */
.device-name-saved {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        color: #27ae60;
        transform: scale(1);
    }
    50% {
        color: #27ae60;
        transform: scale(1.05);
    }
    100% {
        color: inherit;
        transform: scale(1);
    }
}

/* ========================================
   PHASE 4: OTP Feature Styles
   ======================================== */

/* OTP Container */
.vd-otp-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    width: 100%;
}

/* OTP Button */
.vd-btn-otp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.vd-btn-otp:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

.vd-btn-otp:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* OTP Result Container */
.vd-otp-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    border: 2px solid #667eea;
    border-radius: 8px;
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* OTP Code Display */
.vd-otp-code {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: 4px;
    padding: 8px 16px;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* OTP Timer */
.vd-otp-timer {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* OTP Copy Button */
.vd-btn-copy-otp {
    padding: 8px 12px;
    background: #667eea;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vd-btn-copy-otp:hover {
    background: #5568d3;
    transform: scale(1.1);
}

.vd-btn-copy-otp:active {
    transform: scale(0.95);
}

/* OTP Message (Success/Error) */
.vd-otp-message {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.vd-otp-message.vd-otp-success {
    color: #27ae60;
    background: #d5f4e6;
    border-left: 4px solid #27ae60;
}

.vd-otp-message.vd-otp-error {
    color: #e74c3c;
    background: #fadbd8;
    border-left: 4px solid #e74c3c;
}

/* OTP Quota Display (UX #7, UX #8) */
.vd-otp-quota {
    margin-top: 12px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    text-align: left;
}

.vd-otp-quota strong {
    color: #667eea;
    font-weight: 700;
    font-size: 14px;
}

.vd-otp-quota small {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #888;
    font-style: italic;
}

/* UX #8: Tooltip for quota text */
.vd-otp-quota-text {
    cursor: help;
    border-bottom: 1px dotted #667eea;
    position: relative;
}

.vd-otp-quota-text:hover {
    border-bottom-color: #764ba2;
}

/* OTP Expired State */
.vd-otp-timer:contains("Đã hết hạn") {
    color: #e74c3c;
    font-weight: 700;
}

/* OTP Code in Access History */
.history-otp-code {
    color: #667eea;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    white-space: nowrap;
}

.vd-history-simple.success .history-otp-code {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .device-edit-btn {
        font-size: 16px;
        padding: 4px 8px;
        min-width: 32px;
        min-height: 32px;
    }

    .device-name-input {
        min-width: 120px;
        max-width: 250px;
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .device-name-input {
        min-width: 100px;
        max-width: 200px;
        font-size: 14px;
    }
}