:root {
    --primary-color: #ffffff;
    --primary-hover: #e5e5e5;
    --secondary-color: #999999;
    --success-color: #15ff00;
    --error-color: #ff0000;
    --background-color: #0a0a0a;
    --surface-color: #1a1a1a;
    --surface-hover: #242424;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --border-color: #333333;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

html, body, body *:not(input):not(textarea):not(select) {
    text-transform: lowercase;
}

.hidden {
    display: none !important;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--surface-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

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

.loading-screen p {
    margin-top: 16px;
    color: var(--text-secondary);
}

/* Screen Containers */
.screen {
    min-height: 100vh;
    animation: fadeIn 0.4s ease-out;
}

/* Screen Transition Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px 8px rgba(255, 255, 255, 0.15);
    }
}

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

.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

/* Auth Screen */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    animation: scaleIn 0.5s ease-out;
}

.logo i {
    font-size: 48px;
    color: var(--text-primary);
    animation: slideInFromLeft 0.6s ease-out;
}

.logo h1 {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-primary);
    animation: slideInFromRight 0.6s ease-out;
}

.tagline {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 18px;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.login-prompt {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    animation: slideInFromBottom 0.6s ease-out 0.3s both;
}

.user-buttons {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    animation: slideInFromBottom 0.6s ease-out 0.4s both;
}

.user-select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 40px;
    background-color: var(--surface-color);
    border: 3px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-select-btn:hover {
    background-color: var(--surface-hover);
    border-color: var(--primary-color);
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(255, 255, 255, 0.1);
}

.user-select-btn:active {
    transform: translateY(-4px) scale(0.98);
    transition: all 0.1s;
}

.user-select-btn img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    transition: transform 0.3s ease;
}

.user-select-btn:hover img {
    transform: scale(1.1) rotate(5deg);
}

/* Password Screen */
.password-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
}

.back-btn {
    position: absolute;
    top: 24px;
    left: 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    animation: fadeIn 0.4s ease-out;
}

.back-btn:hover {
    color: var(--text-primary);
    transform: translateX(-4px);
}

.selected-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    margin-bottom: 16px;
    animation: scaleIn 0.5s ease-out, breathe 3s ease-in-out infinite;
}

.password-container h2 {
    font-size: 28px;
    margin-bottom: 32px;
    animation: slideInFromBottom 0.5s ease-out 0.1s both;
}

.password-container .input-group {
    margin-bottom: 8px;
}

.password-container .input-group i {
    color: var(--text-secondary);
    margin-right: 8px;
}

/* Username Screen */
.username-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    max-width: 400px;
    margin: 0 auto;
}

.username-container h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.username-container p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.input-group {
    display: flex;
    align-items: center;
    background-color: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0 16px;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInFromBottom 0.5s ease-out 0.2s both;
}

.input-group:focus-within {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.input-prefix {
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 500;
}

.input-group input {
    flex: 1;
    background: none;
    border: none;
    padding: 16px 8px;
    color: var(--text-primary);
    font-size: 18px;
    outline: none;
}

.input-group input::placeholder {
    color: var(--text-secondary);
}

.error-text {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 8px;
}

.success-text {
    color: var(--success-color);
    font-size: 14px;
    margin-top: 8px;
}

.primary-btn {
    background: var(--primary-color);
    color: var(--background-color);
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 24px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.primary-btn:hover::before {
    width: 300px;
    height: 300px;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(255, 255, 255, 0.2);
}

.primary-btn:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s;
}

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

.secondary-btn {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 24px;
    width: 100%;
}

.secondary-btn:hover {
    background-color: var(--surface-hover);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Dashboard */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    animation: slideInFromBottom 0.4s ease-out;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    color: var(--text-primary);
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info span {
    font-weight: 500;
    color: var(--text-primary);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    color: var(--text-primary);
    background-color: var(--surface-hover);
    transform: scale(1.1) rotate(5deg);
}

/* Dashboard Main */
.dashboard-main {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Friend Section - Single Friend Display */
.friend-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
}

/* Messages styles */
.messages-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 720px;
    height: calc(100vh - 200px);
    min-height: 400px;
    max-height: 800px;
    margin: 0 auto;
    animation: scaleIn 0.5s ease-out;
}
.messages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}
.messages-header #messages-with-name {
    font-weight: 600;
    color: var(--text-primary);
}
.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--background-color);
}
.message-item {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: slideInFromBottom 0.3s ease-out;
}
.message-item.sent {
    align-self: flex-end;
}
.message-item.received {
    align-self: flex-start;
}
.message-text {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
}
/* Sent messages: filled black bubble on right */
.message-item.sent .message-text {
    background: var(--primary-color);
    color: var(--background-color);
    border-radius: 18px 18px 4px 18px;
}
/* Received messages: outlined lighter bubble on left */
.message-item.received .message-text {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 18px 18px 18px 4px;
}
.messages-input {
    display: flex;
    gap: 8px;
    padding: 14px;
    border-top: 1px solid var(--border-color);
    background: var(--surface-color);
}
.messages-input input {
    flex: 1;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
}
.messages-input input::placeholder {
    color: var(--text-secondary);
}
.messages-input input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}
.messages-input .primary-btn {
    min-width: 96px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    align-self: flex-start;
    max-width: 75%;
}

.typing-indicator-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 18px 18px 18px 4px;
    color: var(--text-secondary);
    font-size: 14px;
}

.typing-dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
    margin-left: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Read Receipts */
.message-metadata {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    padding: 0 4px;
}

.message-item.sent .message-metadata {
    align-self: flex-end;
}

.message-item.received .message-metadata {
    align-self: flex-start;
}

.read-receipt {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.read-receipt i {
    font-size: 12px;
}

.read-receipt.read {
    color: #4ade80;
}

.read-receipt.delivered {
    color: var(--text-secondary);
}

.friend-section h2 {
    font-size: 24px;
    margin-bottom: 32px;
    color: var(--text-secondary);
    animation: fadeIn 0.5s ease-out;
}

.friend-card-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.5s ease-out;
}

.friend-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary-color);
    margin-bottom: 20px;
    animation: breathe 4s ease-in-out infinite;
}

.friend-card-large h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.friend-card-large p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.send-media-btn-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: var(--background-color);
    font-size: 32px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 12px;
}

.send-media-btn-large:hover {
    background: var(--primary-hover);
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15), 0 0 40px rgba(255, 255, 255, 0.1);
}

.send-media-btn-large:active {
    transform: scale(1.05) rotate(0deg);
    transition: all 0.1s;
}

.send-media-btn-large.has-pending {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.3); }
    70% { box-shadow: 0 0 0 15px rgba(0, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

.send-media-btn-large.sent {
    background: var(--surface-hover);
}

.send-media-btn-large .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--error-color);
    color: var(--background-color);
    font-size: 14px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    min-width: 28px;
    text-align: center;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(255, 0, 0, 0);
    }
}

.btn-hint {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-hint.has-media {
    color: var(--primary-color);
    font-weight: 500;
}

/* Legacy Friend Requests Section - Keep for compatibility */
.friend-requests-section {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.friend-requests-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.friend-requests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.friend-request-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--background-color);
    padding: 12px 16px;
    border-radius: 12px;
}

.request-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.request-user-info img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.request-user-details h4 {
    font-size: 16px;
    font-weight: 600;
}

.request-user-details p {
    font-size: 14px;
    color: var(--text-secondary);
}

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

.accept-btn {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.accept-btn:hover {
    opacity: 0.9;
}

.decline-btn {
    background-color: var(--surface-hover);
    color: var(--text-primary);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.decline-btn:hover {
    background-color: var(--error-color);
}

/* No Friends State */
.no-friends-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.no-friends-state i {
    font-size: 80px;
    color: var(--surface-hover);
    margin-bottom: 24px;
}

.no-friends-state h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.no-friends-state p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.action-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.action-buttons .primary-btn,
.action-buttons .secondary-btn {
    width: auto;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Friends Grid */
.friends-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.friends-header h2 {
    font-size: 24px;
}

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

.small-btn {
    background: var(--primary-color);
    color: var(--background-color);
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.small-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow), 0 0 15px rgba(255, 255, 255, 0.1);
}

.small-btn:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s;
}

.small-btn.secondary {
    background: transparent;
    border: 2px solid var(--border-color);
}

.small-btn.secondary:hover {
    border-color: var(--text-secondary);
}

/* Friends List */
.friends-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 24px;
}

.friend-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--surface-color);
    padding: 24px 16px;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: scaleIn 0.4s ease-out;
}

.friend-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: var(--shadow-lg), 0 0 25px rgba(255, 255, 255, 0.08);
}

.friend-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    margin-bottom: 16px;
}

.friend-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    text-align: center;
}

.friend-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.send-media-btn {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background-color: var(--background-color);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.send-media-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.send-media-btn.has-pending {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.send-media-btn.sent {
    background-color: var(--surface-hover);
    border-color: var(--surface-hover);
    color: var(--text-secondary);
    cursor: default;
}

.send-media-btn .notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: var(--error-color);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--surface-color);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.view-media-content {
    max-width: 600px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
}

.close-modal-btn:hover {
    color: var(--text-primary);
    transform: rotate(90deg) scale(1.2);
}

.modal-body {
    padding: 24px;
}

/* Add Friend Modal */
.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.modal-body input[type="text"] {
    width: 100%;
    background-color: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.modal-body input[type="text"]:focus {
    border-color: var(--primary-color);
}

.modal-body input[type="text"]::placeholder {
    color: var(--text-secondary);
}

.friend-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: var(--background-color);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.friend-preview img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.preview-info h4 {
    font-size: 18px;
    font-weight: 600;
}

.preview-info p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

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

.preview-actions .primary-btn,
.preview-actions .secondary-btn {
    flex: 1;
    margin-top: 0;
}

/* Share Code Modal */
.share-code-body {
    text-align: center;
}

.code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: var(--background-color);
    padding: 20px;
    border-radius: 12px;
    margin-top: 16px;
}

.code-display span {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--primary-color);
}

/* Send Media Modal */
.send-media-body {
    min-height: 300px;
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.05);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

.upload-area i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.upload-area:hover i {
    transform: translateY(-8px) scale(1.1);
}

.upload-area p {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-area span {
    font-size: 14px;
    color: var(--text-secondary);
}

.media-preview-container {
    width: 100%;
    max-height: 300px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.media-preview-container img,
.media-preview-container video {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    background-color: var(--background-color);
}

.message-input {
    margin-bottom: 16px;
}

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

.send-actions .secondary-btn,
.send-actions .primary-btn {
    flex: 1;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#sending-section,
#sent-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

#sent-section .success-icon {
    font-size: 64px;
    color: var(--success-color);
    margin-bottom: 16px;
}

/* View Media Modal */
.view-media-body {
    text-align: center;
}

.unlock-message {
    font-size: 16px;
    color: var(--text-primary) !important;
    margin-bottom: 20px;
}

.locked-preview {
    position: relative;
    margin-bottom: 20px;
}

.blurred-preview {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
    filter: blur(20px);
    -webkit-filter: blur(20px);
}

.media-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.media-badge {
    background-color: var(--primary-color);
    color: var(--background-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.timestamp {
    color: var(--text-secondary);
    font-size: 14px;
}

.unlocked-media-container {
    position: relative;
    margin-bottom: 16px;
}

.unlocked-media-container img,
.unlocked-media-container video {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
    background-color: var(--background-color);
}

.media-message {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Screenshot Protection Overlay */
.screenshot-protected {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
}

.screenshot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: black;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screenshot-overlay p {
    color: white;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 12px 16px;
    }

    .header-left h1 {
        font-size: 20px;
    }

    .user-info span {
        display: none;
    }

    .dashboard-main {
        padding: 16px;
    }

    .messages-card {
        height: calc(100vh - 150px);
        max-height: none;
        border-radius: 12px;
    }

    .messages-list {
        padding: 12px;
    }

    .messages-header {
        padding: 12px;
    }

    .messages-input {
        padding: 12px;
    }

    .friends-header {
        flex-direction: column;
        align-items: stretch;
    }

    .friends-actions {
        justify-content: center;
    }

    .friends-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }

    .friend-avatar {
        width: 80px;
        height: 80px;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .action-buttons .primary-btn,
    .action-buttons .secondary-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 32px;
    }

    .logo i {
        font-size: 36px;
    }

    .tagline {
        font-size: 16px;
    }

    .modal-content {
        border-radius: 16px;
    }

    .friends-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .messages-card {
        height: calc(100vh - 120px);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .message-item {
        max-width: 85%;
    }

    .messages-input input {
        font-size: 16px;
    }

    .messages-input .primary-btn {
        min-width: 80px;
        padding: 12px 16px;
    }
}
