/**
 * Agarmeister OÜ - Main Stylesheet
 * Mobile-first approach
 */

/* ========== CSS Variables ========== */
:root {
    --primary-color: #1a2a4e;
    --accent-color: #ffc107;
    --accent-hover: #ffb300;
    --text-dark: #212529;
    --text-light: #6c757d;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-section: #f1f3f5;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

ul {
    list-style: none;
}

/* ========== Container ========== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ========== Header ========== */
.header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.logo span {
    color: var(--accent-color);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 10px;
}

.lang-btn {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-white);
    color: var(--text-dark);
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.lang-btn:hover,
.lang-btn.active {
    background-color: var(--primary-color);
    color: var(--bg-white);
    border-color: var(--primary-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--primary-color);
    cursor: pointer;
}

/* ========== Hero Section ========== */
.hero {
    background: linear-gradient(135deg, rgba(26, 42, 78, 0.75), rgba(26, 42, 78, 0.65)), url('../images/hero-bg.png') center/cover no-repeat;
    min-height: 600px;
    display: flex;
    align-items: center;
    color: var(--bg-white);
    text-align: center;
    padding: 80px 20px;
}

.hero-content h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    font-size: 16px;
}

.hero-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-feature-item i {
    color: var(--accent-color);
    font-size: 20px;
}

.voltage-badge {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 700;
    margin-left: 10px;
    white-space: nowrap;
    vertical-align: middle;
    transform: translateY(-4px);
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* ========== Buttons ========== */
.btn {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 16px;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background-color: transparent;
    color: var(--bg-white);
    border: 2px solid var(--bg-white);
}

.btn-secondary:hover {
    background-color: var(--bg-white);
    color: var(--primary-color);
}

/* ========== Sections ========== */
section {
    padding: 60px 0;
}

section:nth-child(even) {
    background-color: var(--bg-section);
}

.section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.section-subtitle {
    text-align: center;
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 40px;
}

/* ========== Services Section ========== */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 40px;
}

.service-category {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.service-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.service-icon {
    font-size: 48px;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.service-category h3 {
    font-size: 22px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.service-category ul {
    list-style: none;
}

.service-category li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.service-category li:last-child {
    border-bottom: none;
}

.service-category li::before {
    content: "✓ ";
    color: var(--accent-color);
    font-weight: 700;
    margin-right: 8px;
}

/* ========== Popular Requests Section ========== */
.popular-requests {
    background-color: var(--bg-white);
}

.popular-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 40px;
}

.popular-category {
    background-color: var(--bg-section);
    padding: 30px;
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.popular-category:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.popular-category h3 {
    font-size: 22px;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.popular-category h3 i {
    color: var(--accent-color);
    font-size: 24px;
}

.popular-category ul {
    list-style: none;
}

.popular-category li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.popular-category li:last-child {
    border-bottom: none;
}

.popular-category li::before {
    content: "⚡";
    color: var(--accent-color);
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ========== Packages Section ========== */
.packages-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 40px;
}

.package-card {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    position: relative;
    transition: var(--transition);
}

.package-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.package-popular {
    border: 3px solid var(--accent-color);
}

.package-badge {
    position: absolute;
    top: -15px;
    right: 20px;
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
}

.package-header h3 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.package-description {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.package-price {
    font-size: 42px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.package-features {
    margin: 20px 0;
}

.package-features li {
    padding: 10px 0;
    color: var(--text-dark);
}

.package-features li::before {
    content: "✓ ";
    color: var(--accent-color);
    font-weight: 700;
    margin-right: 8px;
}

.package-additional {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-light);
}

.package-btn {
    width: 100%;
    margin-top: 20px;
}

.packages-note {
    margin-top: 40px;
    padding: 20px 30px;
    background-color: var(--bg-section);
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
}

.packages-note p {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
    color: var(--text-dark);
    font-size: 16px;
}

.packages-note p:first-child {
    margin-top: 0;
}

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

.packages-note i {
    color: var(--accent-color);
    font-size: 20px;
    min-width: 24px;
}

/* ========== How We Work Section ========== */
.steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 40px;
}

.step-item {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
}

.step-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.step-item h3 {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.step-item p {
    color: var(--text-light);
}

/* ========== Why Choose Us Section ========== */
.advantages-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 40px;
}

.advantage-card {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
}

.advantage-icon {
    font-size: 48px;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.advantage-card h3 {
    font-size: 22px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.advantage-card p {
    color: var(--text-light);
}

/* ========== About Master Section ========== */
.about-master {
    background-color: var(--bg-white);
}

.master-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-top: 40px;
    align-items: start;
}

.master-photo {
    text-align: center;
}

.master-photo img {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
    margin: 0 auto;
}

.master-info {
    background-color: var(--bg-section);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.master-timeline {
    margin-bottom: 30px;
}

.timeline-item {
    display: flex;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-year {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-color);
    min-width: 70px;
}

.timeline-text {
    color: var(--text-dark);
    line-height: 1.5;
}

.master-experience {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background-color: var(--primary-color);
    color: var(--bg-white);
    border-radius: 8px;
    margin-top: 20px;
}

.master-experience i {
    font-size: 24px;
    color: var(--accent-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.master-experience span {
    line-height: 1.5;
}

@media (min-width: 768px) {
    .master-content {
        grid-template-columns: 300px 1fr;
    }
}

@media (max-width: 767px) {
    .master-photo img {
        max-width: 250px;
    }

    .master-info {
        padding: 20px 15px;
    }

    .timeline-item {
        flex-direction: column;
        gap: 8px;
    }

    .timeline-year {
        font-size: 20px;
    }

    .master-experience {
        padding: 15px;
    }
}

/* ========== Contact Section ========== */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-top: 40px;
}

/* Contact Form */
.contact-form {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    transition: var(--transition);
    box-sizing: border-box;
    max-width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Contact Info */
.contact-info {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 16px;
    word-break: break-word;
}

.contact-item i {
    font-size: 24px;
    color: var(--accent-color);
    margin-right: 15px;
    min-width: 30px;
}

.contact-item a {
    color: var(--primary-color);
}

.contact-item a:hover {
    color: var(--accent-color);
}

.working-hours {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.working-hours h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* ========== Footer ========== */
.footer {
    background-color: var(--primary-color);
    color: var(--bg-white);
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

.footer-section p,
.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    display: block;
}

.footer-section a:hover {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* ========== Scroll to Top Button ========== */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--accent-color);
    color: var(--primary-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
    z-index: 999;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background-color: var(--accent-hover);
    transform: translateY(-5px);
}

/* ========== Very small mobile (< 360px) ========== */
@media (max-width: 359px) {
    .container {
        padding: 0 8px;
    }

    .logo {
        font-size: 14px;
    }

    .lang-switcher {
        gap: 3px;
    }

    .lang-btn {
        padding: 5px 6px;
        font-size: 11px;
    }
}

/* ========== Mobile adjustments ========== */
@media (max-width: 767px) {
    .container {
        padding: 0 10px;
    }

    .logo {
        font-size: 16px;
    }

    .lang-switcher {
        gap: 5px;
    }

    .lang-btn {
        padding: 6px 8px;
        font-size: 12px;
    }

    .hero {
        padding: 60px 10px;
    }

    .hero-content h1 {
        font-size: 24px;
        line-height: 1.3;
    }

    .hero-content p {
        font-size: 16px;
    }

    .hero-features {
        gap: 10px;
        font-size: 14px;
    }

    .hero-feature-item i {
        font-size: 16px;
    }

    .voltage-badge {
        font-size: 14px;
        padding: 6px 12px;
        margin-left: 5px;
    }

    .popular-category {
        padding: 20px 15px;
    }

    .popular-category h3 {
        font-size: 20px;
    }

    .popular-category li {
        font-size: 15px;
        padding: 10px 0;
    }

    .section-title {
        font-size: 26px;
    }

    .section-subtitle {
        font-size: 16px;
    }

    .service-category,
    .package-card,
    .step-item,
    .advantage-card {
        padding: 20px 15px;
    }

    .contact-form,
    .contact-info {
        padding: 20px 15px;
    }

    .form-group input,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 16px;
    }

    .contact-item {
        font-size: 14px;
        flex-wrap: wrap;
    }

    .contact-item a,
    .contact-item span {
        word-break: break-all;
        overflow-wrap: break-word;
    }

    .contact-item i {
        font-size: 20px;
        margin-right: 10px;
        min-width: 20px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 15px;
    }

    .package-price {
        font-size: 36px;
    }

    .footer-section {
        padding: 0 5px;
    }

    .footer-section a,
    .footer-section p {
        font-size: 14px;
        word-break: break-word;
    }

    .working-hours {
        font-size: 14px;
    }
}

/* ========== Tablet (768px and up) ========== */
@media (min-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .logo {
        font-size: 24px;
    }

    .hero-content h1 {
        font-size: 48px;
    }

    .voltage-badge {
        font-size: 22px;
        padding: 10px 20px;
    }

    .hero-buttons {
        flex-direction: row;
        justify-content: center;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .popular-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .packages-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-wrapper {
        grid-template-columns: 1fr 1fr;
    }

    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========== Desktop (1024px and up) ========== */
@media (min-width: 1024px) {
    .container {
        padding: 0 40px;
    }

    section {
        padding: 80px 0;
    }

    .hero {
        min-height: 700px;
    }

    .hero-content h1 {
        font-size: 56px;
    }

    .voltage-badge {
        font-size: 24px;
        padding: 10px 24px;
    }

    .section-title {
        font-size: 42px;
    }

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .popular-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .packages-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .steps-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .advantages-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ========== Utility Classes ========== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

/* ========== Portfolio Section ========== */
.portfolio {
    background-color: var(--bg-section);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 40px;
}

.portfolio-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover::after {
    opacity: 1;
}

/* ========== Lightbox ========== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 5px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2001;
    transition: var(--transition);
    line-height: 1;
}

.lightbox-close:hover {
    color: var(--accent-color);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: #fff;
    background: rgba(255,255,255,0.1);
    border: none;
    cursor: pointer;
    z-index: 2001;
    padding: 20px 15px;
    transition: var(--transition);
    border-radius: 5px;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.2);
    color: var(--accent-color);
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    background: rgba(0,0,0,0.5);
    padding: 8px 16px;
    border-radius: 20px;
}

/* Portfolio responsive */
@media (min-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
}

@media (max-width: 767px) {
    .lightbox-prev,
    .lightbox-next {
        font-size: 30px;
        padding: 15px 10px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 15px;
        right: 20px;
        font-size: 35px;
    }
}
