/* kcpwd UI Styles - v0.7.0 - Professional Dark Mode */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #6366f1;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Professional Dark Theme Colors */
    --bg-body: #0a0e17;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --bg-hover: #2d3748;

    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --text-disabled: #6b7280;

    --border-primary: #374151;
    --border-secondary: #4b5563;
    --border-focus: #3b82f6;

    /* Subtle colored backgrounds for info boxes */
    --info-bg: rgba(59, 130, 246, 0.1);
    --info-border: rgba(59, 130, 246, 0.3);
    --info-text: #60a5fa;

    --success-bg: rgba(16, 185, 129, 0.1);
    --success-border: rgba(16, 185, 129, 0.3);
    --success-text: #34d399;

    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-border: rgba(245, 158, 11, 0.3);
    --warning-text: #fbbf24;

    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-border: rgba(239, 68, 68, 0.3);
    --danger-text: #fca5a5;

    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-primary);
    animation: slideDown 0.5s ease;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.logo-image:hover {
    transform: scale(1.05);
}

.header-text {
    flex: 1;
}

.header-text h1 {
    margin-bottom: 5px;
}

.header-text p {
    margin: 0;
}

.header h1 {
    color: var(--primary-light);
    margin-bottom: 10px;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.header .status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--info-bg);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--info-text);
    border: 1px solid var(--info-border);
}

/* Auth Form */
.auth-form {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 450px;
    margin: 100px auto;
    border: 1px solid var(--border-primary);
    animation: fadeInScale 0.5s ease;
}

.auth-form h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
    text-align: center;
    font-weight: 600;
}

.auth-form p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-primary);
    animation: fadeIn 0.5s ease;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-primary);
    padding-bottom: 10px;
}

.tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
}

.tab:hover {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.tab.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -11px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--primary);
}

/* Tab Content */
.tab-content {
    animation: fadeIn 0.3s ease;
}

.tab-content h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.tab-content h3 {
    margin: 20px 0 10px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Forms */
input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-tertiary);
}

input::placeholder, textarea::placeholder {
    color: var(--text-disabled);
}

input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    accent-color: var(--primary);
}

input[type="number"] {
    width: 100px;
}

input[type="range"] {
    accent-color: var(--primary);
}

label {
    display: flex;
    align-items: center;
    margin: 12px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Buttons */
button {
    padding: 10px 20px;
    margin: 8px 4px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Password List */
.password-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.password-item {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    border: 1px solid var(--border-primary);
}

.password-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.password-item.master {
    border-left: 3px solid var(--warning);
    background: var(--warning-bg);
}

.password-item.master:hover {
    background: rgba(245, 158, 11, 0.15);
}

.password-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.password-item-info strong {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.password-item-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--warning);
    color: #1f2937;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.password-item-actions {
    display: flex;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-state p {
    color: var(--text-muted);
}

/* Strength Bar */
.strength-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 12px 0;
}

.strength-fill {
    height: 100%;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.strength-fill.very-weak { background: #ef4444; width: 20%; }
.strength-fill.weak { background: #f59e0b; width: 40%; }
.strength-fill.medium { background: #eab308; width: 60%; }
.strength-fill.strong { background: #84cc16; width: 80%; }
.strength-fill.very-strong { background: #10b981; width: 100%; }

.strength-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.strength-text .score {
    font-weight: 600;
}

.strength-text .level {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.strength-text .level.very-weak { color: #ef4444; }
.strength-text .level.weak { color: #f59e0b; }
.strength-text .level.medium { color: #eab308; }
.strength-text .level.strong { color: #84cc16; }
.strength-text .level.very-strong { color: #10b981; }

/* Feedback Lists */
.feedback-list {
    background: var(--info-bg);
    border-left: 3px solid var(--info-border);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin: 15px 0;
}

.feedback-list h4 {
    color: var(--info-text);
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.feedback-list ul {
    list-style: none;
    padding: 0;
}

.feedback-list li {
    padding: 4px 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.feedback-list li::before {
    content: '•';
    margin-right: 8px;
    color: var(--info-text);
}

/* Cards */
.card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin: 15px 0;
    border: 1px solid var(--border-primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-primary);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
}

.toast.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.toast.error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}

.toast.warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
}

.toast.info {
    background: var(--info-bg);
    color: var(--info-text);
    border: 1px solid var(--info-border);
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-content {
    flex: 1;
}

.toast-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    opacity: 0.7;
}

.toast-close:hover {
    opacity: 1;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: fadeIn 0.3s ease;
}

.modal {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border-primary);
    animation: scaleIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    margin: 20px 0;
    color: var(--text-secondary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .loading {
    width: 50px;
    height: 50px;
    border-width: 4px;
    border-color: rgba(59, 130, 246, 0.3);
    border-top-color: var(--primary);
}

.loading-text {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.text-muted {
    color: var(--text-muted);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 20px;
    }

    .header-logo {
        gap: 12px;
    }

    .logo-image {
        width: 48px;
        height: 48px;
    }

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

    .header-text h1 {
        font-size: 1.3rem;
    }

    .main-content {
        padding: 20px;
    }

    .tabs {
        flex-wrap: wrap;
        gap: 4px;
    }

    .tab {
        flex: 1;
        min-width: 90px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .password-item {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .password-item-actions {
        width: 100%;
    }

    .password-item-actions button {
        flex: 1;
    }

    .modal {
        width: 95%;
        padding: 20px;
    }

    .toast {
        right: 10px;
        left: 10px;
        bottom: 10px;
        max-width: none;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

/* Selection */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: var(--text-primary);
}