/* ============================================
   BIROELEKTRONIK - GLAVNI DIZAJN SISTEM
   Modern, čist i profesionalan izgled
   ============================================ */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* CSS Variables - Boje brenda */
:root {
    --primary: #1a1464;
    --primary-light: #2b246e;
    --primary-dark: #0f0d3d;
    --secondary: #6c63ff;
    --accent: #c41e3a;
    --accent-hover: #a01830;
    --white: #ffffff;
    --light-gray: #f8f9fc;
    --gray: #e9ecef;
    --dark-gray: #6c757d;
    --text: #2d3436;
    --text-light: #636e72;
    --shadow: 0 4px 20px rgba(26, 20, 100, 0.15);
    --shadow-lg: 0 10px 40px rgba(26, 20, 100, 0.2);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--light-gray);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER - MODERN NAVBAR
   ============================================ */

.site-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 80px;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 100;
}

.site-logo img {
    height: 55px;
    width: auto;
    transition: var(--transition);
}

.site-logo:hover img {
    transform: scale(1.05);
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
}

/* Header Actions (User, Cart) */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.header-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid transparent;
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.header-icon-btn.active {
    background: var(--accent);
    border-color: var(--white);
}

.header-icon-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid var(--primary);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.cart-badge {
    background: var(--accent);
    color: var(--white);
    border-color: var(--primary);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    overflow: hidden;
    z-index: 1000;
}

.user-dropdown:hover .dropdown-menu,
.user-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 16px;
    background: var(--light-gray);
    border-bottom: 1px solid var(--gray);
}

.dropdown-header span {
    font-size: 13px;
    color: var(--text-light);
}

.dropdown-header strong {
    display: block;
    font-size: 15px;
    color: var(--text);
    margin-top: 2px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.dropdown-item:hover {
    background: var(--light-gray);
    color: var(--primary);
}

.dropdown-item.logout {
    color: #e74c3c;
    border-top: 1px solid var(--gray);
}

.dropdown-item.logout:hover {
    background: #fef5f5;
}

/* Login/Register Buttons */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-login {
    color: var(--white);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-register {
    background: var(--accent);
    color: var(--white);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.btn-register:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.4);
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    z-index: 100;
}

.mobile-toggle span {
    width: 25px;
    height: 3px;
    background: var(--white);
    border-radius: 3px;
    transition: var(--transition);
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Mobile Navigation */
@media (max-width: 1024px) {
    .header-wrapper {
        height: 70px;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
        flex-direction: column;
        padding: 30px 20px;
        gap: 0;
        transform: translateX(-100%);
        transition: var(--transition);
    }
    
    .main-nav.active {
        transform: translateX(0);
    }
    
    .nav-link {
        width: 100%;
        padding: 16px 20px;
        font-size: 18px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-link::after {
        display: none;
    }
    
    .header-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        padding: 16px 24px;
        justify-content: center;
        gap: 24px;
        transform: translateY(100%);
        transition: var(--transition);
    }
    
    .main-nav.active ~ .header-actions,
    .header-actions.active {
        transform: translateY(0);
    }
    
    .site-logo img {
        height: 45px;
    }
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

main {
    flex: 1;
    padding: 40px 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Page Title */
.page-title {
    text-align: center;
    margin-bottom: 40px;
}

.page-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.page-title p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ============================================
   CARDS & SECTIONS
   ============================================ */

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    transition: var(--transition);
}

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

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 20, 100, 0.3);
}

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

.btn-accent:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

/* ============================================
   FORMS
   ============================================ */

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

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 20, 100, 0.1);
}

.form-input::placeholder {
    color: var(--dark-gray);
}

/* ============================================
   PRODUCTS GRID
   ============================================ */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product-image {
    position: relative;
    padding-top: 100%;
    background: var(--light-gray);
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
}

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

.product-name a:hover {
    color: var(--primary);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.product-price.on-request {
    color: var(--accent);
    font-size: 1rem;
}

.product-actions {
    display: flex;
    gap: 12px;
}

/* ============================================
   HERO SECTIONS
   ============================================ */

.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 60px 40px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.hero-text {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 24px;
    position: relative;
    z-index: 1;
}

.hero-btn {
    background: var(--white);
    color: var(--primary);
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.hero-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background: var(--accent);
    color: var(--white);
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 60px 24px 30px;
    margin-top: auto;
}

.footer-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-brand img {
    height: 50px;
    margin-bottom: 16px;
}

.footer-brand p {
    opacity: 0.8;
    font-size: 14px;
    line-height: 1.7;
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--accent);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    opacity: 0.9;
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

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

.footer-social a:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

.footer-bottom {
    max-width: 1400px;
    margin: 40px auto 0;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 14px;
    opacity: 0.7;
}

/* ============================================
   LOADING ANIMATION
   ============================================ */

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fadeIn {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Stagger animations */
.stagger > * {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger > *:nth-child(1) { animation-delay: 0.1s; }
.stagger > *:nth-child(2) { animation-delay: 0.2s; }
.stagger > *:nth-child(3) { animation-delay: 0.3s; }
.stagger > *:nth-child(4) { animation-delay: 0.4s; }
.stagger > *:nth-child(5) { animation-delay: 0.5s; }
.stagger > *:nth-child(6) { animation-delay: 0.6s; }
.stagger > *:nth-child(7) { animation-delay: 0.7s; }
.stagger > *:nth-child(8) { animation-delay: 0.8s; }

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .page-title h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 24px 16px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
}

/* Hide on mobile */
.hide-mobile {
    display: block;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on desktop */
.hide-desktop {
    display: none;
}

@media (max-width: 768px) {
    .hide-desktop {
        display: block !important;
    }
}

/* ============================================
   INLINE ICONS
   ============================================ */

.icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-right: 8px;
    flex-shrink: 0;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-md {
    width: 20px;
    height: 20px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

.icon-primary {
    fill: var(--primary);
}

.icon-accent {
    fill: var(--accent);
}

.icon-white {
    fill: var(--white);
}

.icon-muted {
    fill: var(--text-light);
    opacity: 0.7;
}

