/* =============================================
   DostiSpot.com - Custom Styles
   Premium dark theme with glassmorphism
   ============================================= */

/* ============ ROOT VARIABLES ============ */
:root {
    --gradient-primary: linear-gradient(135deg, #6366F1, #8B5CF6);
    --gradient-secondary: linear-gradient(135deg, #EC4899, #F43F5E);
    --gradient-mixed: linear-gradient(135deg, #6366F1, #EC4899);
    --gradient-dark: linear-gradient(180deg, #0F172A, #1E293B);
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.06);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --radius-xl: 20px;
    --radius-2xl: 24px;
}

/* ============ BASE ============ */
* {
    -webkit-tap-highlight-color: transparent;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

*::-webkit-scrollbar {
    width: 4px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 10px;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0F172A;
    color: #E2E8F0;
    overflow-x: hidden;
}

/* ============ SAFE AREA ============ */
.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.safe-area-top {
    padding-top: env(safe-area-inset-top, 0);
}

/* ============ GLASS MORPHISM ============ */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

.glass-strong {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: var(--shadow-glow);
}

/* ============ GRADIENT TEXT ============ */
.gradient-text {
    background: var(--gradient-mixed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn:hover::after {
    opacity: 1;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 6px 25px rgba(236, 72, 153, 0.5);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #818CF8;
    border: 1.5px solid rgba(99, 102, 241, 0.4);
}

.btn-outline:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366F1;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: #94A3B8;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 10px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: 16px;
}

.btn-block {
    width: 100%;
}

.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

/* ============ FORM INPUTS ============ */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #94A3B8;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: white;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.input-field::placeholder {
    color: #475569;
}

.input-field:focus {
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(15, 23, 42, 1);
}

.input-field:invalid:not(:placeholder-shown) {
    border-color: #EF4444;
}

.input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #475569;
    pointer-events: none;
}

.input-error {
    font-size: 12px;
    color: #EF4444;
    margin-top: 6px;
    display: none;
}

.input-field.error {
    border-color: #EF4444;
}

.input-field.error + .input-error {
    display: block;
}

/* Select */
.select-field {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* ============ CARDS ============ */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 20px;
}

.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: var(--shadow-glow);
}

/* ============ POST CARD ============ */
.post-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0;
    margin-bottom: 1px;
    overflow: hidden;
}

.post-card .post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.post-card .post-media {
    position: relative;
    width: 100%;
    background: #0F172A;
}

.post-card .post-media img,
.post-card .post-media video {
    width: 100%;
    display: block;
    max-height: 500px;
    object-fit: cover;
}

.post-card .post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
}

.post-card .post-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94A3B8;
    cursor: pointer;
    transition: all 0.2s;
    background: none;
    border: none;
    padding: 4px;
    font-size: 13px;
}

.post-card .post-action-btn:hover {
    color: white;
}

.post-card .post-action-btn.liked {
    color: #EF4444;
}

.post-card .post-action-btn.liked i {
    fill: #EF4444;
}

.post-card .post-caption {
    padding: 0 16px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #CBD5E1;
}

.post-card .post-caption .username {
    font-weight: 600;
    color: white;
    margin-right: 6px;
}

/* ============ LOCKED CONTENT OVERLAY ============ */
.locked-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 5;
}

.locked-overlay .lock-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============ AVATAR ============ */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 40px; height: 40px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 80px; height: 80px; }
.avatar-2xl { width: 100px; height: 100px; }

.avatar-online::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #10B981;
    border: 2px solid #0F172A;
    border-radius: 50%;
}

.avatar-verified::after {
    content: '✓';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #6366F1;
    border: 2px solid #0F172A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
}

/* ============ PROFILE HEADER ============ */
.profile-cover {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #1E293B, #334155);
    overflow: hidden;
}

.profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, #0F172A, transparent);
}

.profile-avatar-wrap {
    position: relative;
    margin-top: -50px;
    z-index: 10;
}

/* ============ STORIES / SUGGESTED ============ */
.stories-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stories-scroll::-webkit-scrollbar {
    display: none;
}

.story-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.story-ring {
    padding: 3px;
    border-radius: 50%;
    background: var(--gradient-mixed);
}

.story-ring img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid #0F172A;
    object-fit: cover;
}

.story-name {
    font-size: 11px;
    color: #94A3B8;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.15);
    color: #818CF8;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #FBBF24;
}

.badge-pink {
    background: rgba(236, 72, 153, 0.15);
    color: #F472B6;
}

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 70;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #1E293B;
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 24px;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto 20px;
}

/* ============ TOAST ============ */
.toast {
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: all;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.toast-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95));
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(79, 70, 229, 0.95));
    color: white;
}

.toast-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
    color: white;
}

/* ============ TABS ============ */
.tabs {
    display: flex;
    gap: 2px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 14px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #64748B;
    border-radius: 10px;
    transition: all 0.3s;
    cursor: pointer;
}

.tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

/* ============ STAT CARD ============ */
.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-mixed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 12px;
    color: #64748B;
    margin-top: 4px;
}

/* ============ SKELETON LOADING ============ */
.skeleton {
    background: linear-gradient(90deg, #1E293B 25%, #334155 50%, #1E293B 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ============ ANIMATIONS ============ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

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

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

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

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

@keyframes heartBeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.3); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.6); }
}

.animate-slide-up {
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-heart {
    animation: heartBeat 0.6s ease-in-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

/* ============ PULL TO REFRESH ============ */
.pull-indicator {
    position: fixed;
    top: 56px;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    transition: transform 0.3s;
    border: 1px solid rgba(255,255,255,0.1);
}

/* ============ MEDIA QUERIES ============ */
@media (min-width: 768px) {
    .post-card {
        border-radius: var(--radius-xl);
        margin-bottom: 16px;
    }
}

/* ============ UTILITIES ============ */
.text-gradient {
    background: var(--gradient-mixed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.no-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
