/* PredictFault Mobile PWA Styles */

:root {
    --primary: #1E3A5F;
    --primary-light: #2d5a8a;
    --secondary: #0891B2;
    --accent: #059669;
    --danger: #DC2626;
    --warning: #D97706;
    --success: #059669;
    --white: #ffffff;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    min-height: 100vh;
    color: var(--gray-900);
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    position: relative;
    text-align: center;
    padding: 2rem 1rem 1rem;
    color: var(--white);
}

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

.header-text {
    flex: 1;
    text-align: center;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Hamburger Menu Toggle */
.menu-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
    margin-bottom: 5px;
    transition: all 0.3s;
}

.menu-toggle span:last-child {
    margin-bottom: 0;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Slide Menu */
.slide-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top);
}

.slide-menu.open {
    right: 0;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 1.5rem 1rem;
    color: var(--white);
}

.menu-header span {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-plan-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.menu-plan-badge.pro {
    background: var(--accent);
}

.menu-plan-badge.basic {
    background: var(--secondary);
}

.menu-usage-info {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.usage-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.usage-bar-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 4px;
    transition: width 0.3s;
}

.usage-bar-fill.warning {
    background: var(--warning);
}

.usage-bar-fill.critical {
    background: var(--danger);
}

.menu-usage-info span {
    font-size: 0.8rem;
    color: var(--gray-600);
}

.menu-upgrade-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--gray-200);
}

.menu-upgrade-banner p {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.menu-items {
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

.menu-item {
    display: block;
    width: 100%;
    padding: 1rem 1.25rem;
    border: none;
    background: none;
    text-align: left;
    font-size: 1rem;
    color: var(--gray-700);
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item:hover {
    background: var(--gray-100);
}

.menu-item-danger {
    color: var(--danger);
}

.menu-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.5rem 0;
}

/* Main */
.main {
    flex: 1;
    padding: 0 1rem 1rem;
}

/* Steps */
.step {
    display: none;
}

.step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Card */
.card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.card h2 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 1rem;
    text-align: center;
}

.card-error {
    border: 2px solid var(--danger);
}

.card-error h2 {
    color: var(--danger);
}

/* Form */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

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

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-large {
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-group .btn {
    flex: 1;
}

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

/* Orientation Guide */
.orientation-guide {
    background: var(--gray-100);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.orientation-visual {
    position: relative;
    height: 80px;
    margin-bottom: 0.75rem;
}

.phone-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 30px;
    background: var(--gray-700);
    border-radius: 4px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.phone-icon .phone-screen {
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    background: var(--secondary);
    border-radius: 2px;
}

.phone-icon.tilted {
    transform: translate(-50%, -50%) rotateX(45deg) rotateZ(15deg);
}

.phone-icon.correct {
    background: var(--success);
}

.phone-icon.correct .phone-screen {
    background: #34d399;
}

.surface-icon {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 8px;
    background: linear-gradient(90deg, var(--gray-300) 0%, var(--gray-400) 50%, var(--gray-300) 100%);
    border-radius: 2px;
}

.surface-icon::before {
    content: "MAQUINA";
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: var(--gray-500);
    letter-spacing: 1px;
}

.orientation-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.orientation-status.checking {
    background: var(--gray-200);
    color: var(--gray-600);
}

.orientation-status.warning {
    background: #fef3c7;
    color: var(--warning);
}

.orientation-status.ready {
    background: #d1fae5;
    color: var(--success);
}

.orientation-icon {
    font-size: 1.25rem;
}

.orientation-hint {
    margin-top: 0.5rem;
    color: var(--gray-500);
}

/* Instructions */
.instructions {
    background: var(--gray-100);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.instructions p {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.instructions ol {
    margin-left: 1.25rem;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.instructions li {
    margin-bottom: 0.25rem;
}

/* Recording Status */
.recording-status {
    text-align: center;
    padding: 1.5rem;
}

.status-indicator {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gray-200);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.status-indicator.recording {
    background: var(--danger);
    animation: pulse 1s infinite;
}

.status-indicator.success {
    background: var(--success);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

#status-text {
    font-size: 1rem;
    color: var(--gray-700);
}

.timer {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.5rem;
}

/* Visualizer */
.visualizer {
    background: var(--gray-100);
    border-radius: 10px;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

#vibration-canvas {
    width: 100%;
    height: 80px;
}

/* Loader */
.loader {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--secondary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

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

/* Results */
.result-badge {
    text-align: center;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.result-badge.healthy {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.result-badge.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.result-badge.critical {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.result-badge span {
    font-size: 1.5rem;
    font-weight: 700;
}

.result-badge.healthy span { color: var(--success); }
.result-badge.warning span { color: var(--warning); }
.result-badge.critical span { color: var(--danger); }

.result-details {
    margin-bottom: 1.5rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.result-item label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.result-item .value {
    font-weight: 600;
    color: var(--gray-900);
}

.recommendation {
    background: var(--gray-100);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.recommendation h3 {
    font-size: 0.875rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.recommendation p {
    font-size: 0.95rem;
    color: var(--gray-700);
    line-height: 1.5;
}

/* History */
.history-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.history-empty {
    text-align: center;
    color: var(--gray-500);
    padding: 2rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    gap: 0.75rem;
}

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

.history-item-info {
    flex: 1;
    min-width: 0;
}

.history-item-equipment {
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.history-item-result {
    text-align: right;
}

.history-item-probability {
    font-weight: 700;
    font-size: 1.1rem;
}

.history-item-probability.healthy {
    color: var(--success);
}

.history-item-probability.warning {
    color: var(--warning);
}

.history-item-probability.critical {
    color: var(--danger);
}

.history-item-mode {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

/* Detail View */
.detail-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.detail-header h2 {
    margin-bottom: 0;
    flex: 1;
    text-align: left;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 10px;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-700);
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--gray-200);
}

.detail-section {
    margin-bottom: 1.25rem;
}

.detail-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.detail-item {
    background: var(--gray-100);
    padding: 0.75rem;
    border-radius: 8px;
}

.detail-item label {
    display: block;
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.detail-item span {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.95rem;
}

.detail-item.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.detail-item.highlight label {
    color: rgba(255,255,255,0.8);
}

.detail-item.highlight span {
    color: var(--white);
}

.big-value {
    font-size: 1.5rem !important;
}

.big-value.healthy {
    color: var(--success) !important;
}

.big-value.warning {
    color: var(--warning) !important;
}

.big-value.critical {
    color: var(--danger) !important;
}

/* Chart */
.chart-section {
    margin: 1rem 0;
}

.chart-section h3 {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.chart-container {
    background: var(--gray-100);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

#detail-chart,
#result-chart {
    width: 100%;
    height: 120px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.legend-item::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-item.danger::before {
    background: rgba(239, 68, 68, 0.3);
}

.legend-item.warning::before {
    background: rgba(245, 158, 11, 0.3);
}

.legend-item.normal::before {
    background: rgba(16, 185, 129, 0.3);
}

/* Equipment List */
.equipment-list {
    margin-bottom: 1rem;
}

.equipment-list .loading {
    text-align: center;
    color: var(--gray-500);
    padding: 2rem;
}

.equipment-list .empty {
    text-align: center;
    color: var(--gray-500);
    padding: 2rem;
}

.equipment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.equipment-item:hover {
    background: var(--gray-100);
}

.equipment-item.selected {
    border-color: var(--primary);
    background: rgba(8, 145, 178, 0.05);
}

.equipment-item .eq-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.equipment-item .eq-info {
    flex: 1;
}

.equipment-item .eq-name {
    font-weight: 600;
    color: var(--gray-800);
}

.equipment-item .eq-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.equipment-item .eq-actions {
    display: flex;
    gap: 0.5rem;
}

.equipment-item .eq-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.equipment-item .eq-btn.edit {
    background: var(--gray-200);
    color: var(--gray-600);
}

.equipment-item .eq-btn.edit:hover {
    background: var(--gray-300);
}

.equipment-item .eq-btn.delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.equipment-item .eq-btn.delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

.equipment-item .eq-btn.select {
    background: var(--primary);
    color: white;
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.healthy {
    background: var(--success);
}

.legend-color.warning {
    background: var(--warning);
}

.legend-color.critical {
    background: var(--danger);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.stat-item {
    background: var(--gray-100);
    padding: 0.5rem;
    border-radius: 6px;
    text-align: center;
}

.stat-item label {
    display: block;
    font-size: 0.6rem;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 0.15rem;
}

.stat-item span {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.8rem;
}

/* Danger Button */
.btn-danger {
    background: var(--danger);
    color: var(--white);
}

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

/* Clickable History Items */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    gap: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.history-item:hover {
    background: var(--gray-100);
}

.history-item:active {
    background: var(--gray-200);
}

.history-item-chevron,
.history-item-arrow {
    color: var(--gray-400);
    font-size: 1.5rem;
    font-weight: 300;
    flex-shrink: 0;
}

/* Auth Styles */
.auth-toggle {
    margin-top: 1.5rem;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.auth-toggle p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--secondary);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: underline;
}

.error-text {
    color: var(--danger);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Usage Badge */
.usage-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-100);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.usage-badge span:first-child {
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.usage-badge span:last-child {
    font-size: 0.875rem;
    color: var(--gray-700);
}

/* Upgrade CTA */
.upgrade-cta {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 10px;
    text-align: center;
}

.upgrade-cta p {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Plans Grid */
.plans-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.plan-card {
    position: relative;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.plan-card.featured {
    border-color: var(--secondary);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.2);
}

.plan-card.current {
    border-color: var(--success);
}

.plan-badge {
    position: absolute;
    top: -10px;
    right: 1rem;
    background: var(--secondary);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 10px;
    text-transform: uppercase;
}

.plan-card h3 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.plan-price span {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--gray-500);
}

.plan-features {
    list-style: none;
    text-align: left;
    margin-bottom: 1rem;
}

.plan-features li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.plan-features li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

.plan-card .btn {
    width: 100%;
}

/* User Menu */
.user-menu {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.user-menu-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--white);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 160px;
    z-index: 100;
}

.user-dropdown.hidden {
    display: none;
}

.user-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
}

.user-dropdown-item:hover {
    background: var(--gray-100);
}

.user-dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.user-dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
    color: var(--danger);
}

.user-info {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.user-info-email {
    font-size: 0.8rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info-plan {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
}

/* Limit Warning */
.limit-warning {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.limit-warning p {
    color: var(--danger);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    max-width: 320px;
    text-align: center;
}

.modal-content h2 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.modal-content p {
    color: var(--gray-700);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 360px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .timer {
        font-size: 2rem;
    }
}

/* Safe area for notch phones */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: calc(2rem + env(safe-area-inset-top));
    }
    
    .footer {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
}

/* ==================== Email Verification ==================== */
.verification-info {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.verification-info p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
}

.verification-email {
    font-weight: 600;
    color: var(--primary) !important;
}

#verification-code {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    font-family: monospace;
}

.verification-hint {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.5rem 0 1rem 0;
}

.verification-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.verification-actions .btn-link {
    font-size: 0.9rem;
}
