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

:root {
    --ios-blue: #007AFF;
    --ios-gray: #8E8E93;
    --ios-light-gray: #F2F2F7;
    --ios-card-bg: #FFFFFF;
    --ios-text-primary: #000000;
    --ios-text-secondary: #3C3C43;
    --ios-separator: rgba(60, 60, 67, 0.29);
    --ios-shadow: rgba(0, 0, 0, 0.1);
    --instagram-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background-color: var(--ios-light-gray);
    color: var(--ios-text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    min-height: 100vh;
    background-color: var(--ios-light-gray);
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 20px 40px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px var(--ios-shadow);
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
}

.header-title {
    font-size: 34px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.header-subtitle {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Search Bar */
.search-container {
    padding: 16px 20px;
    background-color: var(--ios-light-gray);
    position: sticky;
    top: 148px;
    z-index: 99;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--ios-card-bg);
    border-radius: 10px;
    padding: 10px 16px;
    box-shadow: 0 1px 3px var(--ios-shadow);
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.search-icon {
    color: var(--ios-gray);
    margin-right: 10px;
    flex-shrink: 0;
}

.search-bar input {
    border: none;
    outline: none;
    font-size: 17px;
    width: 100%;
    background: transparent;
    color: var(--ios-text-primary);
}

.search-bar input::placeholder {
    color: var(--ios-gray);
}

/* Partners List */
.partners-list {
    padding: 0 20px 100px;
}

/* Country Section */
.country-section {
    margin-bottom: 32px;
    animation: fadeIn 0.5s ease;
}

.country-section.hidden {
    display: none;
}

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

.country-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--ios-card-bg);
    border-radius: 12px 12px 0 0;
    margin-bottom: 1px;
}

.country-flag {
    font-size: 28px;
    margin-right: 12px;
}

.country-name {
    font-size: 22px;
    font-weight: 600;
    color: var(--ios-text-primary);
    letter-spacing: -0.3px;
}

/* Partners Group */
.partners-group {
    background-color: var(--ios-card-bg);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

/* Partner Card */
.partner-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 0.5px solid var(--ios-separator);
    transition: background-color 0.2s ease;
}

.partner-card:last-child {
    border-bottom: none;
}

.partner-card:active {
    background-color: var(--ios-light-gray);
}

.partner-card.hidden {
    display: none;
}

.partner-info {
    flex: 1;
    min-width: 0;
}

.partner-name {
    font-size: 17px;
    font-weight: 500;
    color: var(--ios-text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.partner-city {
    font-size: 15px;
    color: var(--ios-gray);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Partner Links */
.partner-links {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    margin-left: 16px;
}

.link-button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.link-button:active {
    transform: scale(0.95);
}

.link-button.instagram {
    background: var(--instagram-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(188, 24, 136, 0.3);
}

.link-button.website {
    background-color: var(--ios-blue);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--ios-gray);
    font-size: 13px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--ios-gray);
}

.no-results-icon {
    font-size: 60px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-results-text {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ios-text-secondary);
}

.no-results-subtext {
    font-size: 15px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive Design */
@media screen and (min-width: 768px) {
    .container {
        max-width: 600px;
        margin: 0 auto;
        box-shadow: 0 0 30px var(--ios-shadow);
    }
    
    .header {
        border-radius: 0;
    }
}

/* Safe Area Insets for iPhone X and newer */
@supports (padding: max(0px)) {
    .header {
        padding-top: max(60px, env(safe-area-inset-top) + 20px);
    }
    
    .footer {
        padding-bottom: max(40px, env(safe-area-inset-bottom) + 20px);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --ios-light-gray: #000000;
        --ios-card-bg: #1C1C1E;
        --ios-text-primary: #FFFFFF;
        --ios-text-secondary: #EBEBF5;
        --ios-separator: rgba(84, 84, 88, 0.65);
    }
    
    body {
        background-color: #000000;
    }
}

/* Touch Highlight */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}
