/* FreeDrop Web App - Mobile-First Design (Exakt wie Android App) */

/* Reset und Basis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    max-width: 414px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.hidden {
    display: none !important;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.app-logo {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Login Screen */
.login-container {
    padding: 60px 30px 30px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    margin-bottom: 50px;
}

.app-logo-large {
    font-size: 5em;
    margin-bottom: 20px;
    color: #4CAF50;
}

.login-header h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 10px;
    font-weight: 700;
}

.login-header p {
    color: #666;
    font-size: 1.1em;
}

/* Google Login Button */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-weight: 500;
}

.google-btn:hover {
    border-color: #4285f4;
    box-shadow: 0 2px 10px rgba(66, 133, 244, 0.2);
}

.google-btn img {
    width: 20px;
    height: 20px;
}

/* Divider */
.divider {
    position: relative;
    margin: 30px 0;
    text-align: center;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}

.divider span {
    background: white;
    padding: 0 20px;
    color: #666;
    font-size: 0.9em;
}

/* Form Styles */
.login-form, .register-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1.1em;
    transition: all 0.3s ease;
    background: #fafafa;
}

.input-group input:focus {
    outline: none;
    border-color: #4CAF50;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    opacity: 0.6;
}

.password-toggle:hover {
    opacity: 1;
}

/* Buttons */
.primary-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: white;
    color: #4CAF50;
    border: 2px solid #4CAF50;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: #4CAF50;
    color: white;
}

.link-btn {
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    text-decoration: underline;
    font-size: inherit;
    font-weight: 600;
}

.link-btn:hover {
    color: #45a049;
}

/* Register Screen */
.register-container {
    padding: 20px 30px;
    min-height: 100vh;
}

.register-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    padding-top: 20px;
}

.back-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #4CAF50;
    padding: 10px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: rgba(76, 175, 80, 0.1);
}

.register-header h2 {
    font-size: 1.8em;
    color: #333;
}

/* Main App Screens */
.main-app {
    position: relative;
    min-height: 100vh;
    padding-bottom: 80px;
}

.screen {
    display: none;
    min-height: calc(100vh - 80px);
    background: white;
}

.screen.active {
    display: block;
}

/* Screen Headers */
.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.screen-header h2 {
    font-size: 1.5em;
    color: #333;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.refresh-btn, .view-toggle-btn, .close-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.refresh-btn:hover, .view-toggle-btn:hover, .close-btn:hover {
    background: #f0f0f0;
    border-color: #4CAF50;
}

/* Search Bar */
.search-bar {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.search-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input-container input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1em;
    background: #fafafa;
}

.search-input-container input:focus {
    outline: none;
    border-color: #4CAF50;
    background: white;
}

.search-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
}

/* Map Container */
.map-container {
    position: relative;
    height: calc(100vh - 160px);
}

.map {
    width: 100%;
    height: 100%;
}

.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-control-btn {
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.2em;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.map-control-btn:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.filter-bar select {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: white;
    font-size: 0.9em;
}

/* Gifts List */
.gifts-count {
    padding: 15px 20px;
    color: #666;
    font-size: 0.9em;
    background: #f8f9fa;
}

.gifts-list {
    padding: 0 20px 20px;
}

.gift-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    margin-bottom: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.gift-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #4CAF50;
}

.gift-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    flex-shrink: 0;
}

.gift-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gift-content {
    flex: 1;
    min-width: 0;
}

.gift-title {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.3;
}

.gift-description {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gift-meta {
    font-size: 0.8em;
    color: #4CAF50;
    font-weight: 500;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 414px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.nav-btn.active {
    color: #4CAF50;
}

.nav-icon {
    font-size: 1.5em;
}

.nav-btn span {
    font-size: 0.8em;
    font-weight: 500;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Profile Screen */
.profile-header {
    padding: 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
}

.profile-details {
    flex: 1;
}

.profile-details h2 {
    margin-bottom: 5px;
    font-size: 1.3em;
}

.profile-details p {
    opacity: 0.9;
    font-size: 0.9em;
}

.profile-stats {
    font-size: 0.8em !important;
    margin-top: 5px;
}

.settings-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 15px 10px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
}

.tab-content {
    flex: 1;
    overflow-y: auto;
}

.tab-pane {
    display: none;
    padding: 20px;
}

.tab-pane.active {
    display: block;
}

/* Gifts Management */
.gifts-management {
    min-height: 400px;
}

.management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.edit-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
}

.bulk-actions {
    display: flex;
    gap: 10px;
}

.bulk-actions .delete-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
}

.bulk-actions .cancel-btn {
    background: #666;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
}

.my-gifts-list, .saved-gifts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gift-item.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.05);
}

.gift-item input[type="checkbox"] {
    margin-right: 10px;
}

.delete-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

/* Settings */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.setting-group h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1em;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.setting-action {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
}

.setting-action.danger {
    background: #f44336;
}

.copyright {
    text-align: center;
    padding: 20px 0;
    color: #666;
    font-size: 0.9em;
}

.logout-section {
    text-align: center;
    padding: 20px 0;
}

.logout-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
}

/* Gift Detail Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 50%;
}

.modal-close:hover {
    background: #f0f0f0;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.detail-images {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.detail-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.no-image {
    width: 120px;
    height: 120px;
    background: #f0f0f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    color: #666;
}

.detail-info h2 {
    margin-bottom: 10px;
    color: #333;
}

.detail-info p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

.detail-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    gap: 10px;
}

.meta-label {
    font-weight: 600;
    min-width: 100px;
}

.detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.save-btn, .map-btn, .share-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.save-btn {
    background: #4CAF50;
    color: white;
}

.map-btn {
    background: #2196F3;
    color: white;
}

.share-btn {
    background: #FF9800;
    color: white;
}

.save-btn:hover, .map-btn:hover, .share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Responsive Design */
@media (max-width: 480px) {
    .app-container {
        max-width: 100%;
    }
    
    .login-container,
    .register-container {
        padding: 40px 20px 20px;
    }
}

@media (min-width: 768px) {
    body {
        background: #f0f0f0;
        padding: 20px 0;
    }
    
    .app-container {
        border-radius: 20px;
        overflow: hidden;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.toast.success {
    background: #4CAF50;
}

.toast.error {
    background: #f44336;
}

.toast.info {
    background: #2196F3;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Utility Classes */
.full-width {
    width: 100%;
}

.text-center {
    text-align: center;
}

.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: " ...";
}