/* =================================
   Stefan Drușcă CMS - Main Stylesheet
   ================================= */

/* Root CSS Variables (set dynamically from database) */
:root {
    --primary-color: #007BFF;
    --font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size: 16px;
    --logo-size: 150px;
    
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --border-color: #ddd;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: #fff;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: darken(var(--primary-color), 10%);
}

/* Navigation Bar */
.navbar {
    background-color: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.navbar-logo img {
    height: var(--logo-size);
    max-width: 100%;
    object-fit: contain;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.navbar-menu a {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.navbar-menu .admin-link {
    color: #28a745;
    font-weight: 600;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.navbar-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    margin: 5px 0;
    transition: 0.3s;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Main Content */
main {
    min-height: 60vh;
    margin-bottom: 3rem;
}

/* Cards */
.card {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Generic two-column layout used by contact page and similar */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}

/* Service card modern styles */
.service-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 2rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.95), var(--bg-light));
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 12px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}
.service-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.service-icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0,0,0,0.03), rgba(0,0,0,0.01));
    color: var(--primary-color);
    font-size: 28px;
}
.service-card h3 {
    margin: 0;
    font-size: 1.25rem;
}
.service-card p {
    margin: 0.5rem 0 0 0;
    color: var(--text-light);
}
.service-list {
    margin-left: 1rem;
    margin-top: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    background-color: #0056b3;
    color: #fff;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="color"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: var(--font-size);
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="color"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.25);
}

textarea {
    resize: vertical;
    min-height: 150px;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Footer */
.footer {
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    list-style: none;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Blog Styling */
.blog-post {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.blog-post h2 {
    margin-bottom: 0.75rem;
    font-size: 1.75rem;
    line-height: 1.3;
}

.blog-post h2 a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-post h2 a:hover {
    color: var(--primary-color);
}

.blog-meta {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-meta i {
    color: var(--primary-color);
}

.blog-excerpt {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.blog-excerpt p {
    color: var(--text-light);
    margin-bottom: 0;
}

.blog-post img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Blog Single Post */
.post {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.post h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.post img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.post .blog-meta {
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.pagination a,
.pagination span {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination .active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

.admin-table tr:hover {
    background-color: var(--bg-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Blog post cards - reduce padding and spacing */
    .blog-post {
        padding: 1rem;
        margin-bottom: 1.5rem;
        border-radius: 8px;
    }
    
    .blog-post h2 {
        font-size: 1.35rem;
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }
    
    .blog-post img {
        height: 200px;
        margin-bottom: 1rem;
        border-radius: 6px;
    }
    
    .blog-meta {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
        flex-wrap: wrap;
    }
    
    .blog-excerpt {
        margin-bottom: 1rem;
        font-size: 0.95rem;
    }
    
    /* Single post - optimize for mobile */
    .post {
        padding: 1.25rem;
        border-radius: 8px;
        margin: 0 0.5rem;
    }
    
    .post h1 {
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    .post img {
        max-height: 250px;
        margin-bottom: 1.25rem;
        border-radius: 6px;
    }
    
    .post .blog-meta {
        padding-bottom: 1rem;
        margin-bottom: 1.25rem;
    }
    
    /* Container spacing */
    .container {
        padding: 1rem;
    }
    
    /* Pagination - better mobile spacing */
    .pagination {
        gap: 0.35rem;
        margin: 2rem 0;
        flex-wrap: wrap;
    }
    
    .pagination a,
    .pagination span {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Navbar mobile */
    .navbar-container {
        /* keep items on a single row: logo + toggle on the left, menu hidden until toggled */
        flex-direction: row;
        padding: 0.75rem 1rem;
        align-items: center;
    }

    .navbar-left {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .navbar-toggle {
        display: flex;
        width: 44px;
        height: 36px;
        align-items: center;
        justify-content: center;
        background: transparent;
        border-radius: 6px;
    }

    .navbar-menu {
        display: none;
        position: absolute;
        top: 64px;
        right: 1rem;
        left: 1rem;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 1rem;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        flex-direction: column;
        gap: 0.75rem;
        z-index: 1200;
    }

    .navbar-menu.active {
        display: flex;
    }

    .navbar-menu a {
        padding: 0.5rem 0.25rem;
        display: block;
        border-bottom: 1px solid rgba(0,0,0,0.03);
    }

    .container {
        padding: 1rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0.5rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }
}

/* ----------------------------------
   Mobile polish: typography, spacing,
   buttons, forms, cards, images
   ---------------------------------- */
@media (max-width: 900px) {
    /* Slightly larger base font for readability on phones */
    html { font-size: 15px; }
    body { line-height: 1.55; }

    /* Hero: stack and tighten */
    .hero {
        padding: 2.25rem 1rem;
        border-radius: 10px;
        text-align: center;
    }
    .hero h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
    .hero p { font-size: 0.95rem; max-width: 680px; margin-left: auto; margin-right: auto; }

    /* Buttons full width where appropriate */
    .hero .btn, .hero .btn-secondary {
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
    }

    /* Use service-card spacing for readability */
    .service-card { padding: 1.25rem; }
    .service-icon { width: 52px; height: 52px; font-size: 22px; }

    /* Card content readability */
    .card, .service-card { font-size: 0.98rem; }

    /* Make CTAs and form buttons easier to tap */
    .btn { display: inline-block; min-width: 160px; }

    /* Forms should be single-column and inputs full width */
    .form-group input, .form-group select, .form-group textarea { width: 100%; }

    /* Images must be responsive and not overflow */
    img { max-width: 100%; height: auto; display: block; }

    /* Slightly reduce container side padding */
    .container { padding-left: 1rem; padding-right: 1rem; }
}

/* About page layout */
.about-intro {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    background: var(--bg-light);
    padding: 1.75rem;
    border-radius: 10px;
    margin-bottom: 1.75rem;
}
.about-image {
    flex: 0 0 220px;
}
.about-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.06);
    background: #fff;
    padding: 6px;
}
.about-content {
    flex: 1;
    font-size: 1rem;
    color: var(--text-dark);
}

@media (max-width: 900px) {
    .about-intro {
        flex-direction: column;
        padding: 1rem;
    }
    .about-image { flex: 0 0 auto; width: 100%; }
    .about-content { font-size: 1rem; }
}

@media (max-width: 480px) {
    /* Tighten up headings and reduce vertical space */
    h1 { font-size: 1.3rem; }
    h2 { font-size: 1.05rem; }

    /* Make primary CTAs full width on tiny screens */
    .btn { width: 100%; padding: 0.65rem; font-size: 0.98rem; }

    /* Compact footer content */
    .footer { padding: 1.25rem; }

    /* Reduce card padding to fit small screens better */
    .card, .service-card { padding: 1rem; border-radius: 8px; }

    /* Ensure the mobile nav is easy to use */
    .navbar-menu { left: 0; right: 0; top: 56px; }
}

/* Footer mobile improvements */
@media (max-width: 900px) {
    .footer {
        padding: 1.25rem 0.75rem;
    }
    .footer-content p {
        margin-bottom: 0.5rem;
        font-size: 0.95rem;
        color: var(--text-light);
    }
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 0.75rem;
        align-items: center;
    }
    .footer-links a {
        display: inline-block;
        padding: 0.35rem 0.5rem;
        border-radius: 6px;
        background: transparent;
        color: var(--text-dark);
    }
}

/* Hero CTA layout improvements */
.hero-cta {
    display: inline-flex;
    gap: 0.75rem;
}
@media (max-width: 768px) {
    .hero-cta {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }
    .hero-cta .btn, .hero-cta .btn-secondary {
        width: 100%;
    }
}

/* Main CTA section (inner page) */
.main-cta {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}
@media (max-width: 768px) {
    .main-cta { flex-direction: column; }
    .main-cta .btn { width: 100%; }
}

/* Legal Pages (GDPR, Privacy, etc.) */
.legal-page {
    max-width: 900px;
    margin: 3rem auto;
    padding: 2rem;
}

.legal-page h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.legal-page .last-updated {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    font-style: italic;
}

.legal-page section {
    margin-bottom: 2.5rem;
}

.legal-page h2 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.legal-page h3 {
    color: var(--text-dark);
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.legal-page p {
    margin-bottom: 1rem;
    text-align: justify;
}

.legal-page ul {
    list-style: none;
    padding-left: 0;
}

.legal-page ul li {
    margin-bottom: 0.75rem;
    padding-left: 2rem;
    position: relative;
}

.legal-page ul li:before {
    content: "▸";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.legal-page a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.legal-page a:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* Legal page mobile optimization */
@media (max-width: 768px) {
    .legal-page {
        padding: 1.5rem;
        margin: 2rem auto;
    }
    
    .legal-page h1 {
        font-size: 1.8rem;
    }
    
    .legal-page h2 {
        font-size: 1.3rem;
    }
    
    .legal-page h3 {
        font-size: 1.1rem;
    }
}
