/* ==========================================
   RESPONSIVE PORTFOLIO STYLESHEET
   ========================================== */

/* Root Variables for Easy Customization */
:root {
    --primary-bg: #ffffff;
    --secondary-bg: #f8f9fa;
    --header-bg: #2c3e50;
    --nav-bg: #34495e;
    --accent-color: #3498db;
    --accent-hover: #2980b9;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --border-color: #ecf0f1;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* ========== GLOBAL STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--secondary-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== HEADER & LOGO ========== */
header {
    background-color: var(--header-bg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

header h1 {
    color: var(--text-light);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin: 0;
    flex: 1;
    min-width: 200px;
}

header .logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

header .logo:hover {
    transform: scale(1.05);
}

/* ========== NAVIGATION ========== */
nav {
    background-color: var(--nav-bg);
    width: 100%;
    box-shadow: var(--shadow);
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
}

nav ul li {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

nav ul li a {
    display: block;
    padding: 1rem;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

nav ul li a:hover,
nav ul li a:focus {
    background-color: var(--accent-color);
    border-bottom-color: var(--accent-hover);
    outline: none;
}

nav ul li a:active {
    background-color: var(--accent-hover);
}

/* ========== MAIN CONTENT ========== */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

section {
    background-color: var(--primary-bg);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

section:hover {
    box-shadow: var(--shadow-lg);
}

section h2 {
    color: var(--accent-color);
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

section p {
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 1rem;
}

section a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

section a:hover,
section a:focus {
    color: var(--accent-hover);
    text-decoration: underline;
    outline: none;
}

/* ========== PROJECTS LIST ========== */
section ul {
    list-style: none;
    padding-left: 0;
}

section ul li {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background-color: var(--secondary-bg);
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
    transition: var(--transition);
}

section ul li:hover {
    background-color: #e8f4f8;
    transform: translateX(5px);
}

/* ========== FORM STYLES ========== */
form {
    max-width: 600px;
    margin: 1.5rem auto;
    padding: 2rem;
    background-color: var(--secondary-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

form label {
    display: block;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

form label:first-child {
    margin-top: 0;
}

form input,
form textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

form input:focus,
form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

form input::placeholder,
form textarea::placeholder {
    color: #bdc3c7;
}

form textarea {
    resize: vertical;
    min-height: 150px;
}

form button {
    background-color: var(--accent-color);
    color: var(--text-light);
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    width: 100%;
}

form button:hover,
form button:focus {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    outline: none;
}

form button:active {
    transform: translateY(0);
}

/* ========== FOOTER ========== */
footer {
    background-color: var(--header-bg);
    color: var(--text-light);
    text-align: center;
    padding: 2rem 1rem;
    margin-top: auto;
    border-top: 3px solid var(--accent-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

footer p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

footer a:hover,
footer a:focus {
    color: var(--text-light);
    text-decoration: underline;
    outline: none;
}

/* ========== ACCESSIBILITY ========== */
/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-color);
    color: var(--text-light);
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-main:focus {
    top: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Tablets (768px and up) */
@media (min-width: 768px) {
    header {
        gap: 2rem;
    }

    main {
        padding: 2.5rem;
    }

    section {
        padding: 2.5rem;
    }

    nav ul li {
        flex: none;
    }

    form {
        padding: 2.5rem;
    }
}

/* Large screens (1024px and up) */
@media (min-width: 1024px) {
    header {
        padding: 2rem;
    }

    header h1 {
        flex: 0 1 auto;
    }

    nav {
        margin-left: auto;
    }

    nav ul {
        justify-content: flex-end;
    }

    nav ul li {
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    nav ul li:last-child {
        border-right: none;
    }

    section {
        padding: 3rem;
    }

    main {
        padding: 3rem;
    }
}

/* Mobile first adjustments */
@media (max-width: 480px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    header .logo {
        width: 60px;
        height: 60px;
    }

    header h1 {
        font-size: 1.25rem;
    }

    nav ul li a {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    section h2 {
        font-size: 1.25rem;
    }

    form button {
        padding: 0.65rem 1.5rem;
    }

    footer {
        padding: 1.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Print styles */
@media print {
    body {
        background-color: white;
    }

    header,
    nav,
    footer {
        display: none;
    }

    section {
        box-shadow: none;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }

    a {
        color: inherit;
    }
}
