:root {
    --primary-color: #2c5282;
    --secondary-color: #e2e8f0;
    --background-color: #f0f0f0;
    --text-color: #333;
    --border-radius: 8px;
    --background-gradient: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    font-size: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--background-gradient);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 1.125rem;
    max-width: 100%;
    margin: 0;
    padding: 16px;
    box-sizing: border-box;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
}

header {
    padding-top: 16px;
    text-align: center;
    margin-bottom: 24px;
    position: relative;
}

h1 {
    color: var(--secondary-color);
    font-size: 2rem !important;
    margin: 1.5rem 0;
    text-align: center;
}

h2 {
    color: var(--secondary-color);
    font-size: 1.375rem;
    margin-bottom: 1rem;
}

.search-section {
    margin-bottom: 24px;
}

.search-container {
    position: relative;
    margin-bottom: 8px;
}

#search-input {
    width: 100%;
    padding: 1.25rem !important;
    font-size: 1.5rem !important;
    border: 3px solid var(--primary-color) !important;
    border-radius: var(--border-radius);
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    background-color: white;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#clear-search {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.75rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    display: none;
}

.search-results {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: none;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.search-result-item, .recent-item {
    background: white;
    padding: 1.25rem !important;
    margin: 0.625rem 0;
    border-radius: var(--border-radius);
    font-size: 1.25rem !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.scientific-name {
    font-weight: bold;
}

.norwegian-name {
    color: #666;
    font-style: italic;
}

.recent-searches {
    padding: 16px; 
}

.recent-searches h2 {
    font-size: 1.125rem;
    margin-bottom: 12px;
    color: var(--secondary-color);
}

.recent-item:last-child {
    border-bottom: none;
}

/* Header og tilbakeknapp */
.back-button {
    position: fixed;
    left: 16px;
    top: 16px;
    text-decoration: none;
    font-size: 1.375rem;
    color: var(--primary-color);
    padding: 8px;
    line-height: 1;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.back-button:hover {
    background: var(--background-color);
}

.breadcrumb {
    font-size: 0.875rem;
    color: #666;
    padding: 0 40px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Artsheader */
.species-header {
    text-align: center;
    margin-bottom: 24px;
}

.species-header h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--secondary-color);
}

.species-header h2 {
    font-size: 1.125rem;
    color: var(--secondary-color);
    font-style: italic;
    font-weight: normal;
}

/* Handlingsknapper */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.action-button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-button .icon {
    font-size: 1.75rem;
    margin-bottom: 10px;
}

.action-button .label {
    font-size: 1rem;
}

/* Infoseksjoner */
.info-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-section h3 {
    color: var(--primary-color);
    font-size: 1.125rem;
    margin-bottom: 12px;
}

/* Synonymliste */
.synonym-item {
    padding: 16px 0;
    border-bottom: 1px solid #eee;
    font-size: 1rem;
}

.synonym-item:last-child {
    border-bottom: none;
}

.synonym-name {
    font-weight: bold;
}

.synonym-author {
    color: #666;
}

/* Variantliste */
.variant-item {
    padding: 16px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
}

.variant-item:last-child {
    border-bottom: none;
}

.variant-info {
    flex: 1;
}

.variant-name {
    font-weight: bold;
}

.variant-rank {
    color: #666;
    font-size: 0.875rem;
}

.variant-norwegian {
    font-style: italic;
    color: #666;
}

.variant-links {
    display: flex;
    gap: 12px;
    font-size: 1.25rem;
}

.variant-links a {
    text-decoration: none;
}

/* Oppdater breadcrumb-stilen */
.breadcrumb-content {
    font-size: 0.875rem;
    color: #666;
    padding: 8px 0;
    line-height: 1.5;
}

/* Legg til disse stilene for taxonomisk sti */
.taxonomic-path {
    list-style: none;
    padding: 0;
}

.taxonomic-path li {
    padding: 4px 0;
    color: #666;
    display: flex;
    align-items: baseline;
}

.taxonomic-path .rank {
    font-size: 0.875rem;
    color: #888;
    width: 90px;
    flex-shrink: 0;
}

.taxonomic-path .name {
    font-weight: bold;
    color: var(--text-color);
}

.taxonomic-path .norwegian {
    margin-left: 8px;
    font-style: italic;
    color: #666;
}

.taxonomic-item {
    padding: 8px 0;
}

.name-container {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.clickable {
    cursor: pointer;
    position: relative;
}

.clickable:hover {
    color: var(--primary-color);
}

.clickable::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    opacity: 0;
    transition: opacity 0.2s;
}

.clickable:hover::after {
    opacity: 1;
}

.taxon-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.taxon-item {
    padding: 12px;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.taxon-item:hover {
    background: #f0f0f0;
}

.taxon-item a {
    text-decoration: none;
    color: var(--text-color);
}

.taxon-name {
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    gap: 16px;
}

.rank-label {
    font-size: 0.875rem;
    color: #666;
    text-transform: capitalize;
}

.name-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.scientific-name {
    font-weight: 500;
    color: var(--primary-color);
}

.norwegian-name {
    color: #666;
    font-style: italic;
    font-size: 0.9em;
}

.species-count {
    font-size: 0.75rem;
    color: #666;
    background: #fff;
    padding: 4px 8px;
    border-radius: 12px;
}

.nav-buttons {
    position: fixed;
    right: 16px;
    top: 16px;
    display: flex;
    gap: 12px;
    z-index: 1000;
}

.back-button, .search-button {
    text-decoration: none;
    font-size: 1.375rem;
    color: var(--primary-color);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s, transform 0.2s;
}

.back-button:hover, .search-button:hover {
    background: var(--background-color);
    transform: scale(1.05);
}

.up-level-container {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.nav-button {
    text-decoration: none;
    font-size: 1rem;
    color: var(--primary-color);
    padding: 12px 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.2s;
}

.nav-button:hover {
    background: var(--background-color);
    transform: scale(1.05);
}

.nav-button i {
    font-size: 0.875rem;
} 