body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}


header {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    box-shadow: 0 3px 5px rgba(0,0,0,0.2);
}

nav {
    background-color: #34495e;
    display: flex;
    justify-content: center;
    padding: 0.8rem 0;
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: #4a6b8a;
}

.active {
    background-color: #3498db;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

section {
    margin-bottom: 3rem;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1, h2 {
    color: #2c3e50;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 0.8rem;
    margin-top: 2rem;
}

p {
    line-height: 1.6;
}

.demo-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.demo-box {
    width: 45%;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.demo-area {
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #ddd;
    background-color: white;
    margin-bottom: 1rem;
    overflow: hidden;
}

.code {
    background-color: #f0f0f0;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    margin: 1rem 0;
}

/* 2D Transformacije */
.shape {
    width: 100px;
    height: 100px;
    background-color: #3498db;
    transition: transform 0.5s ease;
}

.shape-triangle {
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 100px solid #e74c3c;
    transition: transform 0.5s ease;
}

.shape-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #2ecc71;
    transition: transform 0.5s ease;
}

/* Rotate */
.rotate:hover {
    transform: rotate(45deg);
}

/* Scale */
.scale:hover {
    transform: scale(1.5);
}

/* Translate */
.translate:hover {
    transform: translateX(50px);
}

/* Skew */
.skew:hover {
    transform: skew(20deg, 10deg);
}

/* Multiple transformations */
.multiple:hover {
    transform: rotate(45deg) scale(0.8) translateX(20px);
}

/* 3D Transformacije */
.container-3d {
    perspective: 800px;
    perspective-origin: center;
}

.cube {
    width: 100px;
    height: 100px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s;
}

.cube:hover {
    transform: rotateY(180deg) rotateX(45deg);
}

.cube-face {
    position: absolute;
    width: 100px;
    height: 100px;
    background-color: rgba(52, 152, 219, 0.8);
    border: 1px solid rgba(41, 128, 185, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
}

.front { transform: translateZ(50px); background-color: rgba(52, 152, 219, 0.8); }
.back { transform: translateZ(-50px) rotateY(180deg); background-color: rgba(231, 76, 60, 0.8); }
.right { transform: translateX(50px) rotateY(90deg); background-color: rgba(46, 204, 113, 0.8); }
.left { transform: translateX(-50px) rotateY(-90deg); background-color: rgba(241, 196, 15, 0.8); }
.top { transform: translateY(-50px) rotateX(90deg); background-color: rgba(155, 89, 182, 0.8); }
.bottom { transform: translateY(50px) rotateX(-90deg); background-color: rgba(230, 126, 34, 0.8); }

/* TranslateZ demo */
.translatez-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 250px;
    perspective: 1000px;
}

.translatez-item {
    width: 80px;
    height: 80px;
    margin: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #3498db;
    transition: transform 0.5s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

#translatez-1 { transform: translateZ(0px); }
#translatez-2 { transform: translateZ(50px); }
#translatez-3 { transform: translateZ(100px); }

/* Dodatni stilovi za interaktivne elemente */
.interactive-panel {
    padding: 1rem;
    margin: 2rem 0;
    background-color: #ecf0f1;
    border-radius: 8px;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.slider {
    width: 80%;
    margin: 1rem auto;
}

/* Praktična primjena transformacija */
.card-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin: 2rem 0;
}

.card {
    width: 200px;
    height: 300px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-10px) rotateY(5deg);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.card-img {
    height: 150px;
    background-color: #3498db;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5rem;
}

.card-content {
    padding: 1rem;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .demo-box {
        width: 100%;
    }
    
    nav {
        flex-direction: column;
        align-items: center;
    }
    
    nav a {
        margin: 0.5rem 0;
    }
}