/**
 * KIYA.CSS - Main Stylesheet for Kiyasoftapp
 * Professional Web Developer Portfolio - Ethiopia
 * Version: 1.0
 * Author: Anteneh Meseret
 */

/* ===== VARIABLES ===== */
:root {
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --accent: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
    --success: #4ade80;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #343a40;
    --gray-800: #212529;
    --gray-900: #121416;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 15px 30px rgba(0, 0, 0, 0.2);

    --border-radius: 8px;
    --border-radius-lg: 15px;
    --border-radius-xl: 20px;

    --transition: all 0.3s ease;
    --transition-slow: all 0.5s ease;
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5em;
    color: var(--secondary);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 1.8rem);
}

p {
    margin-bottom: 1rem;
    color: var(--gray-600);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary);
}

/* ===== HEADER & NAVIGATION ===== */
header {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-md);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: var(--accent);
    font-size: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--dark);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--dark);
    background: none;
    border: none;
}

/* ===== HERO SECTION ===== */
.hero {
    padding: 150px 0 100px;
    display: flex;
    align-items: center;
    min-height: 100vh;
    gap: 3rem;
}

.hero-content {
    flex: 1;
    animation: fadeInLeft 1s ease-out;
}

.hero-image {
    flex: 1;
    text-align: center;
    animation: fadeInRight 1s ease-out;
}

.hero h1 span {
    color: var(--primary);
    position: relative;
}

.hero h1 span::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 8px;
    bottom: 5px;
    left: 0;
    background-color: rgba(67, 97, 238, 0.2);
    z-index: -1;
    border-radius: 4px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--gray-600);
    max-width: 600px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.cta-button:hover {
    background: var(--secondary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    color: white;
}

.profile-img {
    width: 100%;
    max-width: 350px;
    height: auto;
    aspect-ratio: 350/467;
    border-radius: var(--border-radius-xl);
    object-fit: cover;
    box-shadow: var(--shadow-xl);
    border: 5px solid white;
    transform: perspective(1000px) rotateY(-5deg);
    transition: var(--transition-slow);
}

.profile-img:hover {
    transform: perspective(1000px) rotateY(0deg);
}

/* ===== SECTIONS ===== */
.section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.section-title h2::after {
    content: '';
    position: absolute;
    width: 70px;
    height: 4px;
    background: var(--accent);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.section-title p {
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* ===== PROJECTS GRID ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.project-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));
}

.project-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--secondary);
}

.project-content p {
    color: var(--gray-600);
    margin-bottom: 1rem;
    flex-grow: 1;
    font-size: 0.95rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(67, 97, 238, 0.2);
}

.project-links {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--secondary);
    transform: translateX(5px);
}

/* ===== COMMENTS SYSTEM ===== */
.comments-toggle {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    padding: 0.5rem 0;
}

.comments-toggle:hover {
    color: var(--secondary);
}

.comments-section {
    display: none;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-300);
}

.comments-section.active {
    display: block;
    animation: fadeInUp 0.5s ease-out;
}

.comment-form {
    background: var(--gray-100);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-300);
}

.comment-form h4 {
    margin-bottom: 1rem;
    color: var(--secondary);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.rating-stars {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.rating-stars input {
    display: none;
}

.rating-stars label {
    font-size: 1.5rem;
    color: var(--gray-300);
    cursor: pointer;
    transition: var(--transition);
}

.rating-stars label:hover,
.rating-stars input:checked~label {
    color: var(--warning);
}

.submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.95rem;
}

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

.comments-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.comments-list::-webkit-scrollbar {
    width: 6px;
}

.comments-list::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

.comment-item {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-300);
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.comment-rating {
    color: var(--warning);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.comment-text {
    color: var(--gray-700);
    line-height: 1.5;
    font-size: 0.95rem;
}

.no-comments {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
    font-style: italic;
    background: var(--gray-100);
    border-radius: var(--border-radius);
    border: 1px dashed var(--gray-300);
}

/* ===== CONTACT SECTION ===== */
.contact {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: var(--border-radius-xl);
    padding: 4rem 2.5rem;
    margin: 3rem 0;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.05)" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

.contact-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.contact-text {
    flex: 1;
}

.contact-text h2 {
    color: white;
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.contact-text p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.contact-info {
    flex: 1;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.contact-item:hover .contact-icon {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.contact-details h4 {
    color: white;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.contact-details a,
.contact-details p {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: var(--transition);
    margin: 0;
}

.contact-details a:hover {
    color: white;
    text-decoration: underline;
}

/* ===== FOOTER ===== */
footer {
    background: var(--gray-900);
    color: white;
    padding: 3rem 0 1.5rem;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.social-link {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    transform: translateY(-5px);
    color: white;
}

.copyright {
    opacity: 0.7;
    font-size: 0.9rem;
    color: var(--gray-400);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy-loaded {
    opacity: 1;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large devices (desktops, less than 1200px) */
@media (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
}

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding: 120px 0 80px;
        gap: 2rem;
    }

    .hero-content {
        padding-right: 0;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .contact-content {
        flex-direction: column;
        text-align: center;
    }

    .contact-text {
        margin-bottom: 2rem;
    }

    .contact-item {
        justify-content: center;
    }
}

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    .container {
        max-width: 540px;
        padding: 0 15px;
    }

    .navbar {
        padding: 1rem 0;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        box-shadow: var(--shadow-lg);
        transform: translateY(-150%);
        transition: transform 0.4s ease;
        gap: 1.5rem;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .nav-links li {
        margin: 0;
    }

    .hamburger {
        display: block;
    }

    .hero {
        padding: 100px 0 60px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .profile-img {
        max-width: 280px;
    }

    .section {
        padding: 80px 0;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact {
        padding: 3rem 1.5rem;
        margin: 2rem 0;
    }

    .contact-text h2 {
        font-size: 1.8rem;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .container {
        padding: 0 10px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .profile-img {
        max-width: 250px;
    }

    .section {
        padding: 60px 0;
    }

    .section-title {
        margin-bottom: 3rem;
    }

    .section-title h2 {
        font-size: 1.6rem;
    }

    .project-content {
        padding: 1rem;
    }

    .project-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .contact {
        padding: 2rem 1rem;
    }

    .contact-text h2 {
        font-size: 1.5rem;
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .social-links {
        gap: 0.5rem;
    }

    .social-link {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

/* Print Styles */
@media print {

    .navbar,
    .social-links,
    .comments-toggle,
    .comment-form {
        display: none !important;
    }

    .hero,
    .section {
        padding: 2rem 0 !important;
        page-break-inside: avoid;
    }

    .project-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid var(--gray-300) !important;
    }

    .cta-button {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary: #0044cc;
        --secondary: #002266;
        --accent: #0066cc;
    }

    .project-card {
        border: 2px solid var(--gray-800);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* You can add dark mode styles here if needed */
}

/* Focus styles for accessibility */
a:focus,
button:focus,
.comments-toggle:focus,
.submit-btn:focus,
.project-link:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Skip to main content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--border-radius);
    z-index: 10000;
    transition: var(--transition);
}

.skip-link:focus {
    top: 6px;
}