/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #eff6ff 0%, #fff7ed 100%);
    min-height: 100vh;
    color: #1f2937;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: linear-gradient(135deg, #fed100 0%, #009b3a 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: #fcfcfc;
}

/* Connection Status */
.status-online, .status-offline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-online {
    background-color: #10b981;
}

.status-offline {
    background-color: #ef4444;
}

.status-icon {
    width: 1rem;
    height: 1rem;
}

/* Navigation */
.nav {
    background: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-tabs {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-tab svg {
    width: 1.25rem;
    height: 1.25rem;
}

.nav-tab:hover {
    color: #fed100;
    background-color: #f3f4f6;
}

.nav-tab.active {
    color: #854d0e;
    background-color: #fef3c7;
    border-bottom: 4px solid #fed100;
}

/* Main Content */
.main {
    padding: 1.5rem 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #fed100 0%, #009b3a 100%);
    color: white;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 1.875rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.hero-actions {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Info Cards */
.info-cards {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin-bottom: 1.5rem;
}

.info-card {
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.info-card-blue {
    background-color: #eff6ff;
    border-left: 4px solid #2563eb;
}

.info-card-green {
    background-color: #f0fdf4;
    border-left: 4px solid #10b981;
}

.info-card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.info-card-blue .info-card-title {
    color: #1e40af;
}

.info-card-green .info-card-title {
    color: #065f46;
}

.info-card-text {
    font-size: 0.875rem;
}

.info-card-blue .info-card-text {
    color: #1e3a8a;
}

.info-card-green .info-card-text {
    color: #064e3b;
}

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

.btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.btn-primary {
    background: white;
    color: #f97316;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: #fff7ed;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: white;
    color: #2563eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-success {
    background: white;
    color: #10b981;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.btn-success:hover {
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-submit {
    width: 100%;
    background: linear-gradient(135deg, #fed100 0%, #009b3a 100%);
    color: white;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-success-full {
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #2563eb 100%);
    color: white;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-success-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Section */
.section-header {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: #6b7280;
}

.recent-activity, .section-header {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    color: #9ca3af;
}

.search-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
}

/* Forms */
.form {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input, .form-textarea, select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus, .form-textarea:focus, select:focus {
    outline: none;
    border-color: #2563eb;
}

.form-textarea {
    min-height: 6rem;
    resize: vertical;
}

/* Button Group */
.button-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.toggle-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.toggle-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    margin-bottom: 0.25rem;
}

.toggle-btn.active {
    border-color: #ef4444;
    background-color: #fef2f2;
    color: #b91c1c;
}

.toggle-btn[data-value="supply"].active {
    border-color: #10b981;
    background-color: #f0fdf4;
    color: #065f46;
}

/* Message Cards */
.message-card {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.message-card svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.message-card-content {
    flex: 1;
}

.message-card-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1f2937;
}

.message-card-meta {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Feed Items */
.feed-item {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.feed-item-need {
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
}

.feed-item-supply {
    background-color: #f0fdf4;
    border-left: 4px solid #10b981;
}

.feed-item-safe {
    background-color: #eff6ff;
    border-left: 4px solid #2563eb;
}

.feed-item-looking {
    background-color: #faf5ff;
    border-left: 4px solid #9333ea;
}

.feed-item-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.feed-item-content {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    flex: 1;
}

.feed-item-content svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.feed-item-need svg {
    color: #dc2626;
}

.feed-item-supply svg {
    color: #059669;
}

.feed-item-safe svg {
    color: #2563eb;
}

.feed-item-looking svg {
    color: #9333ea;
}

.feed-item-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
}

.badge-need {
    background-color: #fecaca;
    color: #991b1b;
}

.badge-supply {
    background-color: #bbf7d0;
    color: #14532d;
}

.badge-safe {
    background-color: #bfdbfe;
    color: #1e3a8a;
}

.badge-looking {
    background-color: #e9d5ff;
    color: #6b21a8;
}

.badge-category {
    background-color: #e5e7eb;
    color: #374151;
}

.badge-status {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

.badge-status-synced {
    background-color: #bbf7d0;
    color: #14532d;
}

.badge-status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.feed-item-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.feed-item-meta {
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feed-item-meta svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* Safe List */
.safe-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.safe-list-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.safe-list-content svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #059669;
}

.safe-list-name {
    font-weight: 600;
    color: #1f2937;
}

.safe-list-location {
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.125rem;
}

.safe-list-location svg {
    width: 0.75rem;
    height: 0.75rem;
}

.safe-list-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

/* Footer */
.footer {
    background-color: #1f2937;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
}

.footer-small {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.5rem;
}

/* Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    z-index: 50;
    animation: slideUp 0.3s ease-out;
}

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

.install-prompt.hidden {
    display: none;
}

.install-prompt h3 {
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.install-prompt p {
    color: #6b7280;
    margin-bottom: 1rem;
}

.install-prompt-actions {
    display: flex;
    gap: 0.75rem;
}

.install-prompt-actions .btn {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-actions {
        grid-template-columns: 1fr;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Floating Feedback Button */
.floating-feedback-btn {
    position: fixed;
    bottom: 5rem;
    right: 1rem;
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    z-index: 100;
    transition: all 0.3s ease;
    text-decoration: none;
}

.floating-feedback-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.floating-feedback-btn svg {
    width: 1.5rem;
    height: 1.5rem;
}

@media (max-width: 768px) {
    .floating-feedback-btn {
        bottom: 4rem;
        right: 0.75rem;
        width: 3rem;
        height: 3rem;
    }
    
    .floating-feedback-btn svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}