/* SESHN - Complete UI System */
/* Based on mockups1.html design specifications */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: white;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Screen container - mobile-first design */
.screen {
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
    background: #1a1a1a;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Status bar - removed for production */

/* Main content area */
.screen-content {
    padding: 20px;
    min-height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
}

.screen-content::-webkit-scrollbar {
    display: none;
}

/* App title */
.app-title {
    font-size: 32px;
    font-weight: 900;
    color: white;
    text-align: center;
    margin-bottom: 16px;
}

.app-subtitle {
    font-size: 16px;
    font-weight: 400;
    color: #888;
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.4;
}

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

.form-label {
    color: #888;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.form-input {
    width: 100%;
    padding: 16px;
    background: #2d2d2d;
    border: 1px solid #444;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    border-color: #ff6b35;
    outline: none;
}

.form-input.error {
    border-color: #ff4444;
}

.form-input::placeholder {
    color: #666;
}

/* Buttons */
.primary-button {
    background: linear-gradient(145deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 16px 24px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    font-size: 18px;
    margin: 16px 0;
    transition: all 0.2s ease;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(255, 107, 53, 0.3);
}

.primary-button:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary-button {
    background: transparent;
    color: #ff6b35;
    border: 1px solid #ff6b35;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    margin: 8px 0;
    transition: all 0.2s ease;
}

.secondary-button:hover {
    background: rgba(255, 107, 53, 0.1);
}

.link-button {
    background: none;
    border: none;
    color: #ff6b35;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    display: block;
    margin: 16px auto;
}

.link-button:hover {
    color: #f7931e;
}

/* Messages */
.error-message {
    color: #ff4444;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    color: #00d4aa;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.success-message.show {
    display: block;
}

/* Cards */
.card {
    background: #2d2d2d;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    color: white;
}

/* Notifications Container */
#notifications {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 390px;
    z-index: 1000;
    pointer-events: none;
    padding: 20px;
}

/* Notifications */
.notification {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    transform: translateY(-100px);
    opacity: 0;
    animation: slideDownIn 0.3s ease-out forwards;
}

.notification.error {
    background: linear-gradient(135deg, #ff4444, #cc3333);
}

.notification.success {
    background: linear-gradient(135deg, #00d4aa, #00b894);
}

.notification.slideOut {
    animation: slideUpOut 0.3s ease-in forwards;
}

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

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

/* Header section */
.header-section {
    margin-bottom: 20px;
}

.header-greeting {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}

.header-connection {
    color: #888;
    font-size: 14px;
}

/* Progress elements */
.progress {
    background: #333;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    background: linear-gradient(90deg, #ff6b35, #00d4aa);
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Pack management */
.pack-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pack-edit-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}

.pack-edit-btn:hover {
    color: white;
}

/* Push button */
.push-button {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ff6b35, #f7931e);
    color: white;
    font-size: 20px;
    font-weight: 900;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(255, 107, 53, 0.3);
    transition: all 0.2s ease;
}

.push-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 107, 53, 0.4);
}

.push-button:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.push-button.success {
    background: linear-gradient(145deg, #00d4aa, #00b894);
}

/* Search section */
.search-section {
    margin-bottom: 24px;
}

.search-input {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-input input {
    flex: 1;
}

.search-button {
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.search-button:hover {
    background: #f7931e;
}

/* Connection requests */
.connection-requests {
    background: #2d2d2d;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
}

.request-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    color: white;
    border-bottom: 1px solid #333;
}

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

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

.accept-btn {
    background: #00d4aa;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12px;
    cursor: pointer;
}

.accept-btn:hover {
    background: #00b894;
}

.decline-btn {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12px;
    cursor: pointer;
}

.decline-btn:hover {
    background: #cc3333;
}

/* List items */
.list-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #333;
}

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

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #555;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Empty states */
.empty-state {
    text-align: center;
    color: #888;
    padding: 40px 20px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Loading states */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-top: 2px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.dots {
    display: inline-block;
}

.dots::after {
    content: '.';
    animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #2d2d2d;
    border-radius: 12px;
    padding: 24px;
    max-width: 280px;
    width: 90%;
    text-align: center;
}

.modal h3 {
    color: white;
    margin-bottom: 16px;
}

.modal p {
    color: #888;
    margin-bottom: 24px;
}

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

.confirm-btn {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
}

.cancel-btn {
    background: #555;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 16px 24px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background: #00d4aa;
}

.status-offline {
    background: #ff4444;
}

/* Offline page specific */
.offline-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    text-align: center;
}

.retry-btn {
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 16px 32px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 24px;
}

.retry-btn:hover {
    background: #f7931e;
}

.retry-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

/* Number input container */
.number-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.number-input-container input {
    flex: 1;
}

.number-btn {
    background: #555;
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.number-btn:hover {
    background: #666;
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: #ff6b35; }
.text-secondary { color: #888; }
.text-success { color: #00d4aa; }
.text-error { color: #ff4444; }
.text-muted { color: #666; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }

.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mb-xl { margin-bottom: 32px; }
.mb-2xl { margin-bottom: 40px; }
.mb-3xl { margin-bottom: 48px; }

.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 32px; }
.mt-2xl { margin-top: 40px; }
.mt-3xl { margin-top: 48px; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 16px; }

/* Responsive adjustments */
@media (max-width: 375px) {
    .screen-content {
        padding: 16px;
    }
    
    .push-button {
        width: 160px;
        height: 160px;
        font-size: 18px;
    }
    
    .app-title {
        font-size: 28px;
    }
    
    .footer-section {
        padding: 16px 0;
        margin-top: 32px;
    }
    
    .pin-digit {
        width: 50px;
        height: 60px;
        font-size: 20px;
    }
    
    .pin-inputs {
        gap: 8px;
    }
}

/* Dark theme focus indicators */
.form-input:focus,
.primary-button:focus,
.secondary-button:focus,
.search-button:focus,
.accept-btn:focus,
.decline-btn:focus,
.confirm-btn:focus,
.cancel-btn:focus,
.retry-btn:focus,
.number-btn:focus,
.push-button:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

/* Magic Link UI Styles */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.separator {
    color: #666;
    font-size: 14px;
}

.success-state {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.success-state h3 {
    color: #fff;
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 600;
}

.success-state p {
    color: #ccc;
    margin: 0 0 12px 0;
    font-size: 16px;
    line-height: 1.4;
}

.success-state .text-secondary {
    color: #888;
    font-size: 14px;
}

/* PIN Entry Component */
.pin-entry-container {
    text-align: center;
    margin: 20px 0;
}

.pin-entry-container h3 {
    color: white;
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 600;
}

.pin-instruction {
    color: #ccc;
    margin: 0 0 32px 0;
    font-size: 16px;
    line-height: 1.4;
}

.pin-entry {
    margin: 32px 0;
}

.pin-inputs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.pin-digit {
    width: 60px;
    height: 70px;
    border: 2px solid #444;
    border-radius: 8px;
    background: #2d2d2d;
    color: white;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    transition: all 0.2s ease;
}

.pin-digit:focus {
    border-color: #ff6b35;
    background: #333;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.pin-digit.filled {
    border-color: #ff6b35;
    background: #333;
}

.pin-digit.error {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    animation: shake 0.3s ease-in-out;
}

.pin-helper-text {
    color: #888;
    font-size: 14px;
    margin-top: 16px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Footer section */
.footer-section {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.notification-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 280px;
}

.setting-label {
    color: #ccc;
    font-size: 16px;
}

/* iOS-style switch */
.ios-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 30px;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: 0.3s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #ff6b35;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.logout-link {
    color: #888;
    text-decoration: none;
    font-size: 14px;
    margin-top: 8px;
    transition: color 0.2s ease;
}

.logout-link:hover {
    color: #ff6b35;
    text-decoration: underline;
}

/* Remove extra bottom padding from screen content */
.screen-content {
    padding: 20px;
}