/* Shared styles for DISC app (index.html, login.html, admin.html) */

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

body {
    font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #0b0f14;
    color: #e6edf3;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 16px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
}

.section h2 {
    color: #3b82f6;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.question {
    margin-bottom: 30px;
    padding: 20px;
    background: #1f2937;
    border-radius: 12px;
}

.question h3 {
    margin-bottom: 15px;
    color: #e6edf3;
    font-size: 1.1rem;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    padding: 12px 16px;
    background: #374151;
    border: 2px solid #4b5563;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.option:hover {
    background: #4b5563;
    border-color: #6b7280;
}

.option-text {
    font-weight: 600;
    margin-bottom: 4px;
    color: #e6edf3;
}

.option-description {
    font-size: 0.9em;
    color: #9ca3af;
    line-height: 1.4;
}

.option.selected {
    background: #2563eb;
    border-color: #3b82f6;
    color: white;
}

.option.selected .option-description {
    color: #bfdbfe;
}

/* DISC Color-coded ranking system */
.option.rank-1 {
    background: #059669;
    border-color: #10b981;
    color: white;
}

.option.rank-1 .option-description {
    color: #a7f3d0;
}

.option.rank-2 {
    background: #eab308;
    border-color: #facc15;
    color: white;
}

.option.rank-2 .option-description {
    color: #fef3c7;
}

.option.rank-3 {
    background: #ea580c;
    border-color: #fb923c;
    color: white;
}

.option.rank-3 .option-description {
    color: #fed7aa;
}

.option.rank-4 {
    background: #dc2626;
    border-color: #ef4444;
    color: white;
}

.option.rank-4 .option-description {
    color: #fecaca;
}

.option.rank-5 {
    background: #b91c1c;
    border-color: #dc2626;
    color: white;
}

.option.rank-6 {
    background: #991b1b;
    border-color: #b91c1c;
    color: white;
}

.option.most {
    background: #059669;
    border-color: #10b981;
}

.option.least {
    background: #dc2626;
    border-color: #ef4444;
}

.submit-section {
    text-align: center;
    padding: 30px;
}

.submit-btn {
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
}

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

.progress {
    width: 100%;
    height: 8px;
    background: #374151;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    width: 0%;
    transition: width 0.3s;
}

.instructions {
    background: #1e40af;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0b0f14;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: #e6edf3;
}

.loading-content .loading {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 4px solid #374151;
    border-top: 4px solid #3b82f6;
}

.btn {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn:hover {
    background: #1d4ed8;
}

/* Email delete functionality */
.email-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #374151;
    border-radius: 6px;
    margin-bottom: 8px;
}

.email-item .email-address {
    flex-grow: 1;
    font-family: monospace;
    font-size: 14px;
}

.email-item .email-secondary {
    display: block;
    font-family: monospace;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

.email-item .email-name {
    display: block;
    font-family: inherit;
    font-size: 13px;
    color: #60a5fa;
    margin-top: 2px;
    font-weight: 500;
}

.email-item .email-date {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

.email-item .email-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.email-item .delete-email-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.email-item:hover .delete-email-btn {
    opacity: 1;
}

.email-item .delete-email-btn:hover {
    background: #b91c1c;
}

/* GHL Entry styles */
.ghl-entry-info {
    flex-grow: 1;
}

.ghl-entry-info .phone-number {
    font-family: monospace;
    font-size: 16px;
    font-weight: 600;
    color: #e6edf3;
}

.ghl-entry-info .email-address {
    font-family: monospace;
    font-size: 14px;
    color: #9ca3af;
}

/* Status tags */
.status-tag {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-tag.status-completed {
    background: #10b981;
    color: white;
}

.status-tag.status-incomplete {
    background: #ef4444;
    color: white;
}

.status-tag.status-no-token {
    background: #f59e0b;
    color: #000000;
}

/* Generate token button */
.generate-token-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 8px;
}

.generate-token-btn:hover {
    background: #2563eb;
}

/* Debug buttons */
.debug-btn {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 8px;
}

.debug-btn:hover {
    background: #d97706;
}

/* Token generation modal styles */
.token-email-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #374151;
    border-radius: 6px;
    margin-bottom: 4px;
}

.token-email-item input[type="checkbox"] {
    margin-right: 12px;
}

.token-email-item label {
    flex-grow: 1;
    font-family: monospace;
    font-size: 14px;
    cursor: pointer;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid #4b5563;
    background: #374151;
    color: #e5e7eb;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.filter-btn:hover {
    background: #4b5563;
}

/* Danger button styling */
.danger-btn {
    background: #dc2626 !important;
    color: white !important;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.danger-btn:hover {
    background: #b91c1c !important;
}

.danger-btn:disabled {
    background: #6b7280 !important;
    cursor: not-allowed;
}

/* Loading state */
.loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

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

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .section {
        padding: 20px;
    }
}

/* Google Translate Widget Styling */
#google_translate_element {
    display: inline-block;
}

.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

.goog-te-gadget {
    font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.goog-te-gadget-simple {
    background-color: #3b82f6 !important;
    border: 1px solid #60a5fa !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    color: #ffffff !important;
    font-size: 14px !important;
}

.goog-te-gadget-simple:hover {
    background-color: #60a5fa !important;
    border-color: #93c5fd !important;
}

.goog-te-gadget-icon {
    display: none !important;
}

.goog-te-gadget-simple .goog-te-menu-value span {
    color: #ffffff !important;
}

.goog-te-gadget-simple .goog-te-menu-value:before {
    content: "🌐 ";
}

/* Auth / Login specific styles */
.auth-container {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.auth-page-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: #9ca3af;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: #1f2937;
    border: 2px solid #374151;
    border-radius: 8px;
    color: #e6edf3;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
}

.auth-button {
    width: 100%;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    margin-bottom: 16px;
}

.auth-button:hover {
    transform: translateY(-1px);
}

.auth-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.toggle-form {
    text-align: center;
    color: #9ca3af;
}

.toggle-form a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.toggle-form a:hover {
    text-decoration: underline;
}

.error-message {
    background: #dc2626;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.success-message {
    background: #059669;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.auth-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* small helpers */
.text-muted { color: #9ca3af; }

/* Admin panel specific styles */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #111827;
    border-right: 1px solid #1f2937;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #1f2937;
}

.sidebar-header h2 {
    color: #3b82f6;
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.sidebar-header p {
    color: #9ca3af;
    font-size: 0.9rem;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: block;
    padding: 12px 20px;
    color: #e6edf3;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.nav-item:hover {
    background: #1f2937;
    color: #3b82f6;
}

.nav-item.active {
    background: #1e40af;
    color: white;
    border-right: 3px solid #3b82f6;
}

.nav-item i {
    margin-right: 8px;
    width: 16px;
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

/* Header */
.admin-header {
    background: #111827;
    border-bottom: 1px solid #1f2937;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-info {
    color: #9ca3af;
    font-size: 14px;
}

.logout-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.logout-btn:hover {
    background: #b91c1c;
}

/* Content area */
.content-area {
    padding: 24px;
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

/* Cards */
.card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.card h2 {
    color: #e6edf3;
    margin-bottom: 16px;
    font-size: 1.25rem;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
}

.stat-label {
    color: #bfdbfe;
    margin-top: 8px;
}

/* Chart placeholder */
.chart-placeholder {
    background: #1f2937;
    border: 2px dashed #374151;
    border-radius: 8px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 1.1rem;
}

/* Search and actions */
.search-section {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    background: #1f2937;
    border: 2px solid #374151;
    border-radius: 8px;
    color: #e6edf3;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: #2563eb;
}

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

.btn-secondary:hover {
    background: #4b5563;
}

/* Client list */
.client-list {
    background: #1f2937;
    border-radius: 8px;
    overflow: hidden;
}

.client-item {
    padding: 16px 20px;
    border-bottom: 1px solid #374151;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.client-item:hover {
    background: #374151;
}

.client-item:last-child {
    border-bottom: none;
}

.client-info h3 {
    color: #e6edf3;
    margin-bottom: 4px;
}

.client-info p {
    color: #9ca3af;
    font-size: 14px;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #111827;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    border: 1px solid #1f2937;
}

.modal-header {
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #e6edf3;
    margin-bottom: 8px;
}

.modal-body {
    margin-bottom: 24px;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: #1f2937;
    border: 2px solid #374151;
    border-radius: 8px;
    color: #e6edf3;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Delete confirmation specific styles */
.modal-content #deleteClientName {
    color: #ef4444;
    font-weight: bold;
}

.modal-content #deleteConfirmInput {
    border-color: #ef4444;
}

.modal-content #deleteConfirmInput:focus {
    border-color: #dc2626;
}

.modal-content #confirmDeleteBtn:disabled {
    background: #6b7280 !important;
    cursor: not-allowed;
}

/* Loading */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

.hidden {
    display: none;
}

/* Client asset management */
.breadcrumb {
    margin-bottom: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #374151;
}

.breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 8px;
    color: #6b7280;
}

.page-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #e6edf3;
}

.page-subtitle {
    color: #9ca3af;
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
    }

    .search-section {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
