* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
}

/* ==================== HEADER ==================== */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 3rem 1rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.3rem;
    opacity: 0.9;
}

/* ==================== MAIN CONTENT - GRID ==================== */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* ==================== TRANSFORMATION CARD ==================== */
.transformation-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: grid;
    grid-template-rows: auto 1fr;
}

.transformation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.transformation-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.8rem;
    margin: 0;
}

.badge {
    background: rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
}

.card-content {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* ==================== OBJAŠNJENJA ==================== */
.explanation {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.explanation h3 {
    font-size: 1.3rem;
    color: #667eea;
    margin-top: 0;
}

.explanation h4 {
    color: #764ba2;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.explanation code {
    background: #f5f5f5;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    display: block;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
    border-left: 4px solid #667eea;
}

.explanation ul {
    list-style: none;
    padding-left: 0;
}

.explanation li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.explanation li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* ==================== PRIMJERI - GRID ==================== */
.examples {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.example {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 1rem;
    border: 2px solid #f0f0f0;
    transition: border-color 0.3s ease;
}

.example:hover {
    border-color: #667eea;
}

.example h4 {
    margin-top: 0;
    color: #764ba2;
    margin-bottom: 1rem;
}

/* ==================== DEMO BOX ==================== */
.demo-box {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    height: 200px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.demo-box::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(102, 126, 234, 0.1) 19px, rgba(102, 126, 234, 0.1) 20px),
        repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(102, 126, 234, 0.1) 19px, rgba(102, 126, 234, 0.1) 20px);
    pointer-events: none;
}

/* ==================== SHAPE - OSNOVNI OBLIK ==================== */
.shape {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
    position: relative;
    z-index: 1;
}

.label {
    font-size: 0.7rem;
    text-align: center;
}

/* ==================== TRANSFORMACIJE ==================== */

/* TRANSLATE */
.translate-basic {
    transform: translate(50px, 30px);
}

.translate-x {
    transform: translateX(80px);
}

.translate-y {
    transform: translateY(60px);
}

/* ROTATE */
.rotate-45 {
    transform: rotate(45deg);
}

.rotate-90 {
    transform: rotate(90deg);
}

.rotate-neg60 {
    transform: rotate(-60deg);
}

/* SCALE */
.scale-15 {
    transform: scale(1.5);
}

.scale-06 {
    transform: scale(0.6);
}

.scale-x2 {
    transform: scaleX(2);
}

/* SKEW */
.skew-basic {
    transform: skew(20deg, 10deg);
}

.skew-x {
    transform: skewX(30deg);
}

.skew-y {
    transform: skewY(25deg);
}

/* KOMBINOVANE */
.combined-1 {
    transform: translate(40px, 20px) rotate(25deg);
}

.combined-2 {
    transform: scale(1.3) rotate(15deg) skewX(10deg);
}

.combined-3 {
    transform: translate(30px, 30px) scale(1.1) rotate(30deg) skewY(5deg);
}

/* TRANSFORM-ORIGIN */
.origin-center {
    transform-origin: center center;
    transform: rotate(45deg);
}

.origin-topleft {
    transform-origin: top left;
    transform: rotate(45deg);
}

.origin-bottomright {
    transform-origin: bottom right;
    transform: rotate(45deg);
}

/* HOVER EFEKT */
.hover-zoom {
    transition: transform 0.3s ease;
}

.hover-zoom:hover {
    transform: scale(1.3) rotate(10deg);
}

/* ANIMACIJA - SPINNING */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.animation-spin {
    animation: spin 2s infinite linear;
}

/* ==================== CODE BLOK ==================== */
.example code {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 0.8rem;
    border-radius: 5px;
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    line-height: 1.4;
}

/* ==================== FOOTER ==================== */
.footer {
    background: #1a1a1a;
    color: white;
    padding: 3rem 1rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-content h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: #667eea;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    padding: 0.5rem 0;
    padding-left: 1rem;
    position: relative;
}

.footer-section li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #667eea;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #667eea;
}

.footer-content p {
    text-align: center;
    border-top: 1px solid #444;
    padding-top: 1.5rem;
    opacity: 0.8;
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 1200px) {
    .card-content {
        grid-template-columns: 1fr;
    }

    .examples {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .header p {
        font-size: 1rem;
    }

    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .card-header h2 {
        font-size: 1.3rem;
    }

    .card-content {
        padding: 1.5rem;
        grid-template-columns: 1fr;
    }

    .examples {
        grid-template-columns: 1fr;
    }

    .explanation code {
        font-size: 0.75rem;
    }

    .example code {
        font-size: 0.75rem;
    }

    .demo-box {
        height: 150px;
    }

    .shape {
        width: 60px;
        height: 60px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem 1rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header p {
        font-size: 0.9rem;
    }

    .main-content {
        padding: 0 0.5rem;
        gap: 1rem;
    }

    .card-header {
        padding: 1rem;
    }

    .card-header h2 {
        font-size: 1.1rem;
    }

    .card-content {
        padding: 1rem;
    }

    .demo-box {
        height: 120px;
    }

    .shape {
        width: 50px;
        height: 50px;
    }

    .label {
        font-size: 0.6rem;
    }

    .explanation code,
    .example code {
        font-size: 0.65rem;
        padding: 0.5rem;
    }
}