/* ============================================
   AC Bilgisayar - Modern Theme Styles
   Version: 2.0
   Updated: 2025
   ============================================ */

/* CSS Variables for Easy Theming */
:root {
    /* Primary Colors */
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --primary-light: #5dade2;

    /* Secondary Colors */
    --secondary-color: #2c3e50;
    --secondary-light: #34495e;

    /* Accent Colors */
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --info-color: #3498db;

    /* Neutral Colors */
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --bg-dark: #212529;
    --text-color: #333333;
    --text-light: #6c757d;
    --border-color: #dee2e6;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 2rem;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);

    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-base: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;

    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --bg-light: #2d2d2d;
    --bg-dark: #0d0d0d;
    --text-color: #e0e0e0;
    --text-light: #a0a0a0;
    --border-color: #404040;
    --primary-color: #5dade2;
    --secondary-color: #34495e;
}

/* ============================================
   Global Improvements
   ============================================ */

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color var(--transition-base), color var(--transition-base);
    padding-top: 130px; /* Navbar height (80px) + spacing (50px) = 130px */
}

/* Ensure content stays below navbar */
#wrapper {
    position: relative;
    z-index: 1;
}

/* Carousel/Slider z-index fix */
.carousel,
.flexslider,
#slider,
section {
    position: relative;
    z-index: 1;
}

/* Content area dark mode support */
#content {
    background: var(--bg-color);
    transition: background var(--transition-base);
}

[data-theme="dark"] #content {
    background: var(--bg-color);
}

/* Container backgrounds in dark mode */
[data-theme="dark"] .container,
[data-theme="dark"] .row {
    background: transparent;
}

/* Heading colors in dark mode */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

/* ============================================
   Modern Navigation
   ============================================ */

.navbar {
    background: var(--bg-color) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    border: none;
    transition: all var(--transition-base);
    padding: 0.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050 !important;
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
    padding: 0.25rem 0;
}

/* Dark mode navbar */
[data-theme="dark"] .navbar {
    background: var(--bg-dark) !important;
    border-bottom: 1px solid var(--border-color);
}

/* Navbar toggler icon color fix for dark mode */
[data-theme="dark"] .navbar-toggler {
    border-color: var(--border-color);
}

[data-theme="dark"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform var(--transition-fast);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}

.navbar-brand img:hover {
    box-shadow: var(--shadow-md);
}

.navbar-nav > li > a {
    font-weight: 500;
    color: var(--text-color) !important;
    padding: 0.75rem 1.25rem !important;
    margin: 0 0.25rem;
    border-radius: var(--radius-md);
    position: relative;
    transition: all var(--transition-fast);
}

.navbar-nav > li > a:hover,
.navbar-nav > li.active > a {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.navbar-nav > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    transition: all var(--transition-fast);
    transform: translateX(-50%);
}

.navbar-nav > li > a:hover::after,
.navbar-nav > li.active > a::after {
    width: 80%;
}

/* ============================================
   Dark Mode Toggle Button (Navbar)
   ============================================ */

#theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.1rem;
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle:hover {
    background: var(--bg-light);
    color: var(--primary-color);
    transform: rotate(20deg);
}

#theme-toggle:active {
    transform: scale(0.9) rotate(20deg);
}

#theme-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Dark mode icon switch */
[data-theme="dark"] #theme-toggle i::before {
    content: "\f185"; /* fa-sun */
}

[data-theme="light"] #theme-toggle i::before {
    content: "\f186"; /* fa-moon */
}

/* ============================================
   Modern Cards & Containers
   ============================================ */

.card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* ============================================
   Modern Buttons
   ============================================ */

.btn {
    font-weight: 500;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    transition: all var(--transition-fast);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width var(--transition-base), height var(--transition-base);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   Modern Forms
   ============================================ */

.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all var(--transition-fast);
    background: var(--bg-color);
    color: var(--text-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    outline: none;
}

/* Placeholder styling for dark mode */
.form-control::placeholder {
    color: var(--text-light);
    opacity: 1;
}

[data-theme="dark"] .form-control::placeholder {
    color: rgba(255, 255, 255, 0.85);
    opacity: 1;
}

/* Firefox placeholder fix */
.form-control::-moz-placeholder {
    color: var(--text-light);
    opacity: 1;
}

[data-theme="dark"] .form-control::-moz-placeholder {
    color: rgba(255, 255, 255, 0.85);
    opacity: 1;
}

/* IE placeholder fix */
.form-control:-ms-input-placeholder {
    color: var(--text-light);
    opacity: 1;
}

[data-theme="dark"] .form-control:-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.85);
    opacity: 1;
}

.form-label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

/* ============================================
   Scroll to Top Button Enhancement
   ============================================ */

.scrollup {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.scrollup:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: var(--shadow-xl);
}

.scrollup i {
    color: white;
    font-size: 1.25rem;
}

/* Mobile adjustment */
@media (max-width: 768px) {
    .scrollup {
        width: 40px;
        height: 40px;
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .scrollup i {
        font-size: 1rem;
    }
}

/* ============================================
   Footer Improvements
   ============================================ */

footer {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    color: rgba(255, 255, 255, 0.9);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
    transition: background var(--transition-base);
}

/* Dark mode footer */
[data-theme="dark"] footer {
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
}

footer h4,
footer h5,
footer .widgetheading {
    color: white;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: all var(--transition-fast);
}

footer a:hover {
    color: white;
    transform: translateX(5px);
    display: inline-block;
}

/* Sub-footer styling */
#sub-footer {
    background: rgba(0, 0, 0, 0.1);
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: background var(--transition-base);
}

[data-theme="dark"] #sub-footer {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-color);
}

#sub-footer .copyright,
#sub-footer .credits {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

#sub-footer .copyright p {
    margin-bottom: 0.5rem;
}

#sub-footer .credits a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

#sub-footer .credits a:hover {
    color: white;
    text-decoration: underline;
}

/* Social network icons */
.social-network {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.social-network li {
    list-style: none;
}

.social-network a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: all var(--transition-fast);
    transform: translateX(0) !important;
}

.social-network a:hover {
    background: var(--primary-color);
    transform: translateY(-3px) translateX(0) !important;
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .social-network a {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .social-network a:hover {
    background: var(--primary-color);
}

/* Footer widgets */
footer .widget {
    margin-bottom: 2rem;
}

footer .widget ul.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

footer .widget ul.link-list li {
    margin-bottom: 0.5rem;
}

footer .flickr_badge img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    margin: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

footer .flickr_badge img:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

/* Responsive sub-footer */
@media (max-width: 768px) {
    .social-network {
        justify-content: center;
        margin-top: 1rem;
    }

    #sub-footer .copyright {
        text-align: center;
    }
}

/* ============================================
   Blog Cards
   ============================================ */

.blog-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    background: var(--bg-color);
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.blog-card img {
    transition: transform var(--transition-slow);
}

.blog-card:hover img {
    transform: scale(1.1);
}

/* ============================================
   Loading Spinner
   ============================================ */

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Slider/Carousel Dark Mode Support
   ============================================ */

[data-theme="dark"] .flexslider,
[data-theme="dark"] .carousel {
    background: var(--bg-dark);
}

[data-theme="dark"] .flex-caption,
[data-theme="dark"] .carousel-caption {
    color: var(--text-color);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .navbar-nav > li > a {
        margin: 0.25rem 0;
    }

    #theme-toggle {
        font-size: 1rem;
        padding: 0.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glassmorphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.hover-lift {
    transition: transform var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* ============================================
   Services/Portfolio Grid Fix
   ============================================ */

/* Portfolio container */
#thumbs.portfolio {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Portfolio items - ensures proper grid layout */
#thumbs.portfolio > li {
    flex: 0 0 calc(25% - 0.75rem); /* 4 columns with gap */
    max-width: calc(25% - 0.75rem);
    margin-bottom: 0 !important;
    list-style: none;
}

/* Item container */
#thumbs .item-thumbs {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    background: var(--bg-color);
    height: 100%;
}

#thumbs .item-thumbs:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Image styling */
#thumbs .item-thumbs img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-slow);
}

#thumbs .item-thumbs:hover img {
    transform: scale(1.1);
}

/* Hover overlay */
#thumbs .hover-wrap {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

#thumbs .overlay-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(52, 152, 219, 0.9);
    opacity: 0;
    transition: opacity var(--transition-base);
}

#thumbs .item-thumbs:hover .overlay-img {
    opacity: 1;
}

#thumbs .overlay-img-thumb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2rem;
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 3;
}

#thumbs .item-thumbs:hover .overlay-img-thumb {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    #thumbs.portfolio > li {
        flex: 0 0 calc(33.333% - 0.67rem); /* 3 columns */
        max-width: calc(33.333% - 0.67rem);
    }
}

@media (max-width: 768px) {
    #thumbs.portfolio > li {
        flex: 0 0 calc(50% - 0.5rem); /* 2 columns */
        max-width: calc(50% - 0.5rem);
    }

    #thumbs.portfolio {
        gap: 1rem;
    }

    #thumbs .item-thumbs img {
        height: 200px;
    }
}

@media (max-width: 576px) {
    #thumbs.portfolio > li {
        flex: 0 0 100%; /* 1 column */
        max-width: 100%;
    }

    #thumbs .item-thumbs img {
        height: 220px;
    }
}

/* ============================================
   Contact Form Improvements
   ============================================ */

/* Contact form button styling */
#contact .btn-info {
    background: linear-gradient(135deg, var(--info-color), var(--primary-dark));
    border: none;
    transition: all var(--transition-fast);
    width: 100%;
    max-width: 100%;
}

#contact .btn-info:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark), var(--info-color));
}

/* Ensure button matches form control width */
#contact #mailGonder {
    width: 100% !important;
    display: block;
}

/* Contact form dark mode */
[data-theme="dark"] #contact.color-dark.bg-gray {
    background: var(--bg-dark) !important;
}

[data-theme="dark"] #contact .section-heading h2 {
    color: var(--text-color);
}

/* Responsive contact form */
@media (max-width: 768px) {
    #contact #mailGonder {
        padding: 12px !important;
        font-size: 1rem !important;
    }
}
