:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --text-color: #333;
    --light-bg: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    text-align: center;
    padding: 40px 0;
    background-color: var(--primary-color);
    color: white;
    margin-bottom: 30px;
    border-radius: 0 0 10px 10px;
}

h1 {
    margin-bottom: 20px;
}

.intro {
    font-size: 1.2rem;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--light-bg);
    border-radius: 10px;
}

section {
    margin-bottom: 40px;
}

h2 {
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

ul {
    list-style-position: inside;
    margin-left: 20px;
}

code {
    background-color: var(--light-bg);
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
}

.code-block {
    background-color: #282c34;
    color: #fff;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 15px 0;
    font-family: 'Courier New', Courier, monospace;
}

.property {
    background-color: var(--light-bg);
    padding: 20px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 20px;
    border-radius: 0 5px 5px 0;
}

.property h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.example-container {
    background-color: var(--light-bg);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.example-title {
    font-weight: bold;
    margin-bottom: 10px;
}

/* Primjeri animacija */
.box {
    width: 100px;
    height: 100px;
    background-color: var(--primary-color);
    margin: 20px auto;
}

/* Osnovni primjer */
.animated-box {
    animation-name: moveAround;
    animation-duration: 4s;
    animation-iteration-count: infinite;
}

@keyframes moveAround {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(200px);
    }
    50% {
        transform: translateX(200px) translateY(100px);
    }
    75% {
        transform: translateX(0) translateY(100px);
    }
    100% {
        transform: translateX(0) translateY(0);
    }
}

/* Primjer za timing-function */
.timing-box {
    display: flex;
    justify-content: space-around;
    margin: 40px 0;
}

.timing-item {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    animation-name: moveDown;
    animation-duration: 3s;
    animation-iteration-count: infinite;
}

.ease { animation-timing-function: ease; }
.linear { animation-timing-function: linear; }
.ease-in { animation-timing-function: ease-in; }
.ease-out { animation-timing-function: ease-out; }
.ease-in-out { animation-timing-function: ease-in-out; }

@keyframes moveDown {
    0% { transform: translateY(0); }
    50% { transform: translateY(100px); }
    100% { transform: translateY(0); }
}

/* Primjer za direction */
.direction-box {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    animation-name: moveRight;
    animation-duration: 2s;
    animation-iteration-count: infinite;
}

.normal { animation-direction: normal; }
.reverse { animation-direction: reverse; }
.alternate { animation-direction: alternate; }
.alternate-reverse { animation-direction: alternate-reverse; }

@keyframes moveRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(200px); }
}

/* Primjer za fill-mode */
.fill-mode-box {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    animation-name: changeColor;
    animation-duration: 3s;
    animation-iteration-count: 1;
}

.none { animation-fill-mode: none; }
.forwards { animation-fill-mode: forwards; }
.backwards { animation-fill-mode: backwards; animation-delay: 2s; }
.both { animation-fill-mode: both; animation-delay: 2s; }

@keyframes changeColor {
    0% { background-color: red; }
    100% { background-color: green; }
}

footer {
    text-align: center;
    padding: 20px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 10px 10px 0 0;
    margin-top: 50px;
}