/* === Modern Professional Portfolio CSS === */

/* === CSS Variables för enkel anpassning === */
:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --accent-hover: #2980b9;
    --text-dark: #2c3e50;
    --text-medium: #555;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --bg-card: #ffffff;
    --border-color: #e1e8ed;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    height: 100%;
    line-height: 1.6;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 18px;
}

/* === Navbar === */
nav {
    display: flex;
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    height: 70px;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    text-decoration: none;
    font-size: 16px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all var(--transition-smooth);
    height: 70px; /* Fast höjd istället för 100% */
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--accent-color);
    transition: all var(--transition-smooth);
    transform: translateX(-50%);
}

nav a:hover::after {
    width: 80%;
}

nav a:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--accent-color);
}

/* === Main Content === */
main,
.main {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1; /* Under footern men över bakgrunden */
}

main {
    padding: 60px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    flex: 1;
    padding-bottom: 60px; /* Extra utrymme innan footer */
}

.wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 60px;
    flex-wrap: wrap;
}

/* === Profile Section === */
.profile {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 30px;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.6s ease-out;
}

.avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-lg);
    border: 4px solid var(--accent-color);
    transition: transform var(--transition-smooth);
}

.avatar:hover {
    transform: scale(1.05);
}

.info h1 {
    margin: 0 0 12px 0;
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.info p {
    font-size: 16px;
    margin: 8px 0;
    color: var(--text-medium);
    display: flex;
    align-items: center;
    gap: 8px;
}

.info a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.info a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* === About Section === */
.about {
    flex: 2;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.about h2 {
    font-size: 32px;
    margin-bottom: 24px;
    color: var(--text-dark);
    font-weight: 700;
    position: relative;
    padding-bottom: 12px;
}

.about h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    border-radius: 2px;
}

.about p {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 20px;
    color: var(--text-medium);
}

.about p:last-child {
    margin-bottom: 0;
}

section {
    margin-bottom: 80px;
}

/* === Projects Grid === */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
    animation: fadeIn 0.6s ease-out;
    width: 100%;
    grid-auto-rows: 1fr; /* Gör alla rader lika höga */
}

.project-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-smooth);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%; /* Gör alla kort lika höga */
    min-height: 200px; /* Mindre för techniques-sidan */
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.project-card h2 {
    font-size: 22px;
    color: var(--text-dark);
    margin: 0;
    padding: 24px 20px 16px;
    font-weight: 600;
}

.project-card img {
    width: 100%;
    height: 220px;
    object-fit: contain; /* Visa hela bilden utan att beskära */
    background-color: #f5f5f5; /* Ljusgrå bakgrund */
    transition: transform var(--transition-smooth);
    padding: 10px; /* Lite luft runt bilden */
}

.project-card:hover img {
    transform: scale(1.03); /* Mindre zoom för contain */
}

.project-card p {
    font-size: 16px;
    color: var(--text-medium);
    line-height: 1.6;
    padding: 16px 20px 24px;
    flex: 1; /* Gör att texten fyller resterande utrymme */
    display: flex;
    align-items: flex-start; /* Text börjar uppifrån */
}

/* Text fallback om ingen bild finns */
.no-image {
    background: linear-gradient(135deg, var(--bg-light) 0%, #e8eef2 100%);
    color: var(--text-light);
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* === Klickbara kortlänkar === */
.project-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card-link:visited {
    color: inherit;
}

/* === Fullbredd projekt-detaljsida === */
.project-detail {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr;
    gap: 60px;
    width: 100%;
    padding: 40px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.6s ease-out;
}

.project-detail img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.project-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.project-info h1 {
    font-size: 42px;
    color: var(--text-dark);
    margin-bottom: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.project-info p {
    font-size: 18px;
    line-height: 1.8;
    margin: 12px 0;
    color: var(--text-medium);
}

.project-info strong {
    color: var(--text-dark);
    font-weight: 600;
}

.project-buttons {
    margin-top: 32px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.project-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.project-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Teknik-lista */
.techniques {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-light);
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
}

.techniques strong {
    display: block;
    margin-bottom: 16px;
    font-size: 20px;
    color: var(--text-dark);
    font-weight: 600;
}

.techniques p {
    font-size: 16px;
    color: var(--text-medium);
    font-family: "Courier New", monospace;
    letter-spacing: 0.5px;
    line-height: 1.8;
}

/* Beskrivning */
.project-description {
    margin-top: 32px;
    font-size: 18px;
    color: var(--text-medium);
    line-height: 1.8;
    text-align: justify;
}

/* === Filterlayout === */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 40px 0;
    padding: 32px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.filter-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-search {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input,
.filter-bar button {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.filter-bar input {
    width: 400px;
    max-width: 100%;
}

.filter-bar button {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-smooth);
}

.filter-bar button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Lägg till minsta höjd för att förhindra footer overlap */
.content {
    min-height: calc(100vh - 170px); /* Justerat för mindre footer: viewport - nav(70px) - footer(~100px) */
}

/* === Meddelande om inga resultat === */
.content > p {
    text-align: center;
    font-size: 18px;
    color: var(--text-medium);
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
    margin-top: 40px;
}

/* === Teknikfilter-boxar === */
.filter-techniques {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.tech-box {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    background-color: var(--bg-card);
    transition: all var(--transition-fast);
    cursor: pointer;
    min-height: 48px; /* Konsekvent höjd */
}

.tech-box:hover {
    background-color: #f0f7ff;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.tech-box input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color);
    cursor: pointer;
    flex-shrink: 0; /* Förhindra att checkbox krymper */
}

.tech-box label {
    font-size: 15px;
    color: var(--text-dark);
    cursor: pointer;
    text-transform: capitalize;
    font-weight: 500;
    word-break: break-word; /* Bryt långa ord */
    line-height: 1.3;
}

/* === Footer === */
footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: white;
    text-align: center;
    padding: 25px 20px; /* Minskad från 40px */
    width: 100%;
    margin-top: auto;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10; /* Footern ska vara över korten */
}

footer .socials {
    display: flex;
    gap: 20px; /* Minskad från 24px */
    justify-content: center;
    margin-bottom: 12px; /* Minskad från 20px */
}

footer a {
    color: white;
    font-size: 24px; /* Minskad från 28px */
    text-decoration: none;
    transition: all var(--transition-smooth);
    width: 44px; /* Minskad från 50px */
    height: 44px; /* Minskad från 50px */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

footer a:hover {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
}

footer .copyright {
    font-size: 13px; /* Minskad från 14px */
    margin: 0;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

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

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

/* === Responsivitet === */
@media (min-width: 769px) {
    /* Desktop och tablet - säkerställ 70px nav */
    nav {
        height: 70px !important;
    }
}

@media (max-width: 1440px) {
    html {
        font-size: 17px;
    }
    .avatar {
        width: 180px;
        height: 180px;
    }
}

@media (max-width: 1024px) {
    html {
        font-size: 16px;
    }
    
    .wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .profile {
        flex-direction: column;
        text-align: center;
    }
    
    .project-detail {
        grid-template-columns: 1fr;
    }
    
    main,
    .main {
        padding: 40px 20px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    nav {
        height: auto;
        flex-direction: column; /* Stack länkar vertikalt på mobil */
    }
    
    nav a {
        height: auto; /* Auto höjd på mobil */
        padding: 16px;
        font-size: 14px;
        width: 100%; /* Full bredd */
    }
    
    .avatar {
        width: 150px;
        height: 150px;
    }
    
    .info h1 {
        font-size: 28px;
    }
    
    .about h2 {
        font-size: 26px;
    }
    
    .project-info h1 {
        font-size: 32px;
    }
    
    .filter-bar input {
        width: 100%;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    footer .socials {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    main,
    .main {
        padding: 24px 16px;
    }
    
    .about,
    .profile,
    .filter-bar {
        padding: 24px;
    }
    
    .project-detail {
        padding: 24px;
    }
}