/**
 * FlingNow - Base Styles
 * Every pixel chosen.
 */

/* ========================================
   PAGE TRANSITIONS
   ======================================== */

.page-wrapper {
    height: 100%;
    animation: pageEnter var(--duration-slow) var(--ease-out) both;
}

.page-exit {
    animation: pageExit var(--duration-fast) var(--ease-out) forwards !important;
}

@keyframes pageEnter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pageExit {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ========================================
   APP NAVIGATION - Unified across pages
   ======================================== */

.app-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-8);
    animation: fadeIn var(--duration-slow) var(--ease-out) both;
}

.app-nav .nav-brand {
    font-family: var(--font-serif);
    font-size: var(--text-xl);
    font-weight: var(--weight-light);
    font-style: italic;
    color: var(--text-primary);
    text-decoration: none;
}

.app-nav .nav-link {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    color: var(--text-tertiary);
    text-decoration: none;
    position: relative;
    padding: var(--space-2) 0;
    transition: color var(--duration-base) var(--ease-out);
}

.app-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: var(--space-px);
    background: var(--text-tertiary);
    transition: width var(--duration-slow) var(--ease-out);
}

.app-nav .nav-link:hover {
    color: var(--text-primary);
}

.app-nav .nav-link:hover::after {
    width: 100%;
}

.app-nav .nav-link.active {
    color: var(--text-primary);
}

.app-nav .nav-link.active::after {
    width: 100%;
    background: var(--accent);
}

/* Unread messages indicator dot */
.app-nav .nav-link.has-unread::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -8px;
    width: 7px;
    height: 7px;
    background: #a85454;
    border-radius: 50%;
    animation: fadeIn var(--duration-base) var(--ease-out) both;
}

@media (max-width: 640px) {
    .app-nav {
        padding: var(--space-4) var(--space-6);
    }
}

/* ========================================
   FOUNDATIONS
   ======================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-sans);
    font-weight: var(--weight-light);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-secondary);
    background: var(--bg-deep);
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header/footer collapse when empty */
.site-header,
.site-footer {
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    min-height: 0;
}

/* Subtle noise texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: var(--noise);
    opacity: 0.015;
    pointer-events: none;
    z-index: 9999;
}

/* Selection */
::selection {
    background: var(--accent-muted);
    color: var(--text-primary);
}

/* Scrollbar - Minimal */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 2px;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: var(--weight-light);
    color: var(--text-primary);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

h1 {
    font-size: var(--text-4xl);
}

h2 {
    font-size: var(--text-2xl);
    letter-spacing: var(--tracking-normal);
}

h3 {
    font-size: var(--text-xl);
}

p {
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    max-width: 48ch;
}

a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--duration-base) var(--ease-out);
}

a:hover {
    color: var(--text-primary);
}

/* Small uppercase text */
.label {
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

label {
    display: block;
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: var(--space-3);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: var(--space-4) 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--weight-light);
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-bottom: var(--space-px) solid var(--border-subtle);
    border-radius: 0;
    outline: none;
    transition: border-color var(--duration-base) var(--ease-out);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-whisper);
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--border-visible);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: var(--leading-relaxed);
}

/* Read-only */
input:read-only {
    color: var(--text-tertiary);
    border-color: var(--border-invisible);
    cursor: default;
}

/* ========================================
   BUTTONS - Typographic objects
   ======================================== */

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    color: var(--text-secondary);
    background: transparent;
    border: var(--space-px) solid var(--border-subtle);
    border-radius: 0;
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    position: relative;
}

button:hover,
.btn:hover {
    color: var(--text-primary);
    border-color: var(--border-visible);
}

button:active,
.btn:active {
    transform: translateY(1px);
}

button:disabled,
.btn:disabled {
    color: var(--text-whisper);
    border-color: var(--border-invisible);
    cursor: not-allowed;
}

/* Primary button - Subtle fill */
.btn-primary {
    background: var(--bg-surface);
    border-color: var(--bg-surface);
    color: var(--text-primary);
}

.btn-primary:hover {
    background: var(--accent-muted);
    border-color: var(--accent-muted);
}

/* Secondary - Text only */
.btn-secondary {
    border: none;
    padding: var(--space-2) 0;
}

.btn-secondary::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: var(--space-px);
    background: var(--text-tertiary);
    transition: width var(--duration-slow) var(--ease-out);
}

.btn-secondary:hover::after {
    width: 100%;
}

/* Danger */
.btn-danger {
    color: #a85454;
    border-color: rgba(168, 84, 84, 0.2);
}

.btn-danger:hover {
    color: #c46b6b;
    border-color: rgba(168, 84, 84, 0.3);
}

/* ========================================
   UTILITY
   ======================================== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Divider - Almost invisible */
.divider {
    height: var(--space-px);
    background: var(--border-invisible);
    margin: var(--space-12) 0;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInSlow {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeIn var(--duration-slow) var(--ease-out) both;
}

.animate-in-slow {
    animation: fadeInSlow var(--duration-slower) var(--ease-out) both;
}

/* Staggered delays */
.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }
.delay-5 { animation-delay: 500ms; }

/* ========================================
   MESSAGE STATES
   ======================================== */

.message {
    padding: var(--space-4);
    font-size: var(--text-sm);
    text-align: center;
    animation: fadeIn var(--duration-base) var(--ease-out);
}

.message:empty {
    display: none;
}

.message.error {
    color: #a85454;
}

.message.success {
    color: #6b8f71;
}

/* ========================================
   BADGE
   ======================================== */

.badge {
    display: inline-flex;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}

.badge-success {
    color: #6b8f71;
    background: rgba(107, 143, 113, 0.1);
}

.badge-error {
    color: #a85454;
    background: rgba(168, 84, 84, 0.1);
}

.badge-warning {
    color: #a89454;
    background: rgba(168, 148, 84, 0.1);
}

/* ========================================
   TOAST
   ======================================== */

.toast-container {
    position: fixed;
    top: var(--space-8);
    right: var(--space-8);
    z-index: 1000;
}

.toast {
    background: var(--bg-raised);
    border: var(--space-px) solid var(--border-subtle);
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-sm);
    animation: fadeIn var(--duration-base) var(--ease-out);
}

/* ========================================
   SPINNER
   ======================================== */

.spinner {
    width: 16px;
    height: 16px;
    border: var(--space-px) solid var(--border-subtle);
    border-top-color: var(--text-tertiary);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   REPORT MODAL
   ======================================== */

.profile-modal-report-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding: var(--space-3) var(--space-5);
    background: transparent;
    border: var(--space-px) solid var(--border-danger, #dc2626);
    border-radius: var(--radius-md);
    color: var(--text-danger, #dc2626);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.profile-modal-report-btn:hover {
    background: var(--bg-danger-subtle, rgba(220, 38, 38, 0.1));
}

.profile-modal-report-btn svg {
    width: 16px;
    height: 16px;
}

.profile-modal-report-btn.hidden {
    display: none;
}

/* Report Modal Overlay */
.report-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.report-modal.hidden {
    display: none;
}

.report-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.report-modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-xl);
}

.report-modal-content h3 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.report-modal-subtitle {
    margin: 0 0 var(--space-5);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.report-reasons {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.report-reason {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-raised);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out);
}

.report-reason:hover {
    background: var(--bg-hover);
}

.report-reason input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.report-reason span {
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.report-description {
    width: 100%;
    min-height: 80px;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-raised);
    border: var(--space-px) solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--text-sm);
    color: var(--text-primary);
    resize: vertical;
    margin-bottom: var(--space-5);
}

.report-description:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.report-description::placeholder {
    color: var(--text-tertiary);
}

.report-modal-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

.report-btn-cancel {
    padding: var(--space-3) var(--space-5);
    background: transparent;
    border: var(--space-px) solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.report-btn-cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.report-btn-submit {
    padding: var(--space-3) var(--space-5);
    background: var(--bg-danger, #dc2626);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: white;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.report-btn-submit:hover:not(:disabled) {
    background: var(--bg-danger-hover, #b91c1c);
}

.report-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Chat Report Button */
.chat-report-btn {
    color: var(--text-danger, #dc2626) !important;
}

.chat-report-btn:hover {
    background: var(--bg-danger-subtle, rgba(220, 38, 38, 0.1)) !important;
}
