@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Globalno */
body {
    font-family: 'Rubik', sans-serif;
    background-color: #000;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Wrapper, da sadrzaj ne leti svuda*/
.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navigacija */
nav {
    display: flex;
    position: fixed;
    z-index: 100;
}

.nav-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: black;
    padding: 12px 20px;
    position: fixed;
    box-shadow: 0 0.1rem 0.2rem 0 rgb(0, 0, 0), 0 6px 20px 0 rgb(57, 0, 0);
    opacity: 90%;
}

/* Logo kao tekst */
.logo a {
    text-decoration: none;
    color: rgb(159, 18, 18);
    font-size: 1.8rem;
    font-weight: 700;
    margin-left: 1.7rem;
}

/* Meni sada cilja UL.menu i LI unutra */
.menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu li {
    padding-left: 30px;
}

.menu li a {
    display: inline-block;
    text-decoration: none;
    color: white;
    text-align: center;
    transition: 0.15s ease-in-out;
    position: relative;
}

.menu li a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: white;
    transition: 0.15s ease-in-out;
}

.menu li a:hover::after {
    width: 100%;
}

/* Hamburger + close */
.open-menu,
.close-menu {
    color: white;
    cursor: pointer;
    font-size: 1.5rem;
    display: none;
}

.open-menu {
    margin-left: 20px; /* po želji */
}

.close-menu {
    /* na mobitelu ćemo je pozicionirati */
}

/* Sakrij checkbox */
#check {
    display: none;
}

/* Hero sekcija / Home */
.hero {
    padding: 6rem 0 3rem;
}

.main-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    flex-wrap: wrap;
}

/* Slika */
.image {
    flex: 1 1 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
}

.image img {
    width: 100%;
    max-width: 420px;
    border-radius: 50%;
    object-fit: cover;
    animation: floatImage 5s ease-in-out infinite;
}

/* Tekst */
.content {
    flex: 1 1 320px;
}

.content h1 {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.content h1 span {
    color: rgb(159, 18, 18);
}

.typing-text{
    font-size: clamp(1rem, 1rem + 5vw, 2.2rem);
    font-weight: 700;
    padding-bottom: 0.5rem;
    position: relative;
    overflow: hidden;
}

.typing-text span::before{
    content: "";
    color: rgb(159, 18, 18);
    animation: words 20s infinite;
}

.typing-text span::after{
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-left: 3px solid black;
    animation: cursor 0.5s infinite;
}

@keyframes cursor {
    to{
        border-left: 3px solid white;
    }
}

@keyframes words {
    0%, 20%{
        content: "Programer";
    }
    21%, 40%{
        content: "Matematičar";
    }
    41%, 60%{
        content: "Muzičar";
    }
    61%, 80%{
        content: "Freelancer";
    }
    81%, 100%{
        content: "Instruktor";
    }
}

.content p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: #e0e0e0;
}

/* Social icons */
.social-links {
    display: flex;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
    text-decoration: none;
}

.social-links a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}

.social-links a:hover {
    background-color: rgb(159, 18, 18);
    border-color: rgb(159, 18, 18);
    transform: translateY(-2px);
    text-decoration: none;
}

/* Dugmad */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    font-size: 0.9rem;
    text-decoration: none;
    letter-spacing: 0.5px;
    border: 1px solid rgb(159, 18, 18);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn.primary {
    background-color: rgb(159, 18, 18);
    color: #fff;
}

.btn.secondary {
    background-color: transparent;
    color: rgb(159, 18, 18);
}

.btn:hover {
    transform: translateY(-1px);
    background-color: #fff;
    color: #000;
}

.image-strelica {
    flex: 1 1 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    padding-top: 3rem;
}

.image-strelica img {
    width: 100%;
    max-width: 30px;
    border-radius: 50%;
    object-fit: cover;
    animation: floatImage 5s ease-in-out infinite;
}

/* Sekcije */
.section {
    padding: 3rem 0;
}

.section-title {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 40%;
    height: 2px;
    background-color: rgb(159, 18, 18);
}

.section-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e0e0e0;
    margin-bottom: 1rem;
}

/* O meni lista */
.about-list {
    margin: 0.7rem 0 1.5rem 1.2rem;
    font-size: 0.95rem;
    color: #e0e0e0;
}

.about-list li {
    margin-bottom: 0.3rem;
}

/* Vjestine sekcija */
.grid-vjestina {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.vjestina-kartica {
    border: 1px solid #333;
    padding: 1rem;
    border-radius: 12px;
    background: radial-gradient(circle at top, #151515, #050505);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.vjestina-kartica h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: rgb(255, 255, 255);
}

.vjestina-kartica p {
    font-size: 0.9rem;
    color: #cccccc;
}

.vjestina-kartica:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 18px rgba(159, 18, 18, 0.35);
    border-color: rgb(159, 18, 18);
}

/* Sekcija projekti */
.projekti-grid {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
}

.projekti-kartice {
    border-radius: 12px;
    padding: 1.1rem;
    background: radial-gradient(circle at top, #151515, #050505);
    border: 1px solid #333;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.slika-projekta {
    width: 100%;
    height: 160px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.8rem;
    border: 1px solid #222;
    background-color: #000;
}

.slika-projekta img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.lista-projekti {
    font-size: 0.9rem;
    color: #d0d0d0;
    margin-top: 0.6rem;
    margin-left: 0.9rem;
}

.projekti-kartice:hover .slika-projekta img {
    transform: scale(1.05);
}

.projekti-kartice h3 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}

.projekti-kartice p {
    font-size: 0.9rem;
    color: #d0d0d0;
}

.projekti-kartice:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 16px rgba(159, 18, 18, 0.3);
    border-color: rgb(159, 18, 18);
}

/* Galerija */
.galerija-grid {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #222;
    background-color: #000;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.gallery-item:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 0 16px rgba(159, 18, 18, 0.3);
    border-color: rgb(159, 18, 18);
}

/* Footer */
footer {
    padding: 1.5rem 0;
    background-color: black;
    /*border-top: 1px solid #333;*/
    box-shadow: 0 0.1rem 0.2rem 0 rgb(0, 0, 0), 0 6px 20px 0 rgb(57, 0, 0);
    opacity: 90%;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: #bbbbbb;
}

/* Social linkovi u footeru */
footer .social-links {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

.nazad-na-vrh {
    text-decoration: none;
    color: rgb(159, 18, 18);
    font-size: 0.85rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.nazad-na-vrh:hover {
    border-color: rgb(159, 18, 18);
    color: #fff;
}

/* Animacije */
@keyframes floatImage {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

@keyframes typing {
    from { width: 0; }
    to { width: 18ch; }
}

@keyframes blinkCursor {
    from { border-right-color: rgb(159, 18, 18); }
    to { border-right-color: transparent; }
}

/* Responzivnost */

@media (max-width: 900px) {
    .wrapper {
        width: 100%;
    }
    .menu {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 80%;
        height: 100vh;
        position: fixed;
        top: 0;
        right: -100%;
        z-index: 100;
        background-color: black;
        transition: all 0.2s ease-in-out;
    }

    .logo a {
        text-decoration: none;
        color: rgb(159, 18, 18);
        font-size: 1.8rem;
        font-weight: 700;
        margin-left: 0.1rem;
    }

    .menu li {
        padding-left: 0;
        margin-top: 40px;
    }

    .menu li a {
        padding: 10px;
    }

    .open-menu,
    .close-menu {
        display: block;
    }

    /* Close ikona u gornji desni ugao menija */
    .close-menu {
        position: absolute;
        top: 20px;
        right: 20px;
    }

    /* Kada je checkbox čekiran, pomjeri meni na ekran */
    #check:checked ~ .menu {
        right: 0;
    }

    .links {
        flex-wrap: wrap;
        gap: 0.8rem;
        font-size: 0.9rem;
    }

    .hero {
        padding-top: 3rem;
    }

    .main-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .content {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .btn-row {
        justify-content: center;
    }

    .section-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo span {
        font-size: 1.4rem;
    }

    .content h1 {
        font-size: 1.7rem;
        margin-bottom: 0.5rem;
    }

    .typing-text {
        font-size: 1.7rem;
    }

    .links {
        gap: 0.6rem;
    }
}

/* Layout za blog i kontakt */
body.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-main {
    flex: 1;
    display: flex;
    align-items: center;       /* centriranje sadržaja po vertikali */
}

.page-main .section {
    width: 100%;
}

.page-main .wrapper {
    width: 100%;
}

.kontakt-kartica {
    display: grid;
    place-items: center; /* Centers both horizontally and vertically */
    border-radius: 12px;
    padding-top: 1.1rem;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
    background: radial-gradient(circle at top, #151515, #050505);
    border: 1px solid #333;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.kontakt-kartica:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 0 16px rgba(159, 18, 18, 0.3);
    border-color: rgb(159, 18, 18);
}

.kontakt-kartica .social-links{

}

.kontakt-kartica strong{
    color: rgb(159, 18, 18);
}

.forma-kartica {
    display: grid;
    place-items: center; /* Centers both horizontally and vertically */
    border-radius: 12px;
    padding: 1.1rem;
    background: radial-gradient(circle at top, #151515, #050505);
    border: 1px solid #333;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.forma-kartica .form-group {
    margin: 0.3rem;
}

.forma-kartica .form-group input, textarea {
    width: 17rem;
}

.forma-kartica:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 0 16px rgba(159, 18, 18, 0.3);
    border-color: rgb(159, 18, 18);
}

/* malo ljepše centriranje naslova/teksta na ovim stranicama */
.page-main .section-title,
.page-main .section-text {
    text-align: center;
}

/* na malim ekranima ne guramo baš u sredinu po visini */
@media (max-width: 600px) {
    .page-main {
        align-items: flex-start;
        padding-top: 1.5rem;
    }
}

.hero .wrapper {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

/* Ograniči i centriraj SAMO sadržaj hero sekcije */
.hero .main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ========== Ovo ako zatreba za navbar margine ========== */
/*.main-container,
.projekti-grid,
.galerija-grid {
    overflow-x: hidden;
}
.typing-text {
    overflow: hidden;
    max-width: 100%;
}
.typing-text span::after {
    width: 100%;
}
 */
/* ========== Background sa kuglicama ========== */
@keyframes move {
    100% {
        transform: translate3d(0, 0, 1px) rotate(360deg);
    }
}

.background {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    background: #000;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.ball {
    position: absolute;
    width: 20vmin;
    height: 20vmin;
    border-radius: 50%;
    backface-visibility: hidden;
    animation: move linear infinite;
}

.ball:nth-child(odd) {
    color: #850101;
}

.ball:nth-child(even) {
    color: #a5372e;
}

/* Using a custom attribute for variability */
.ball:nth-child(1) {
    top: 77%;
    left: 88%;
    animation-duration: 40s;
    animation-delay: -3s;
    transform-origin: 16vw -2vh;
    box-shadow: 40vmin 0 5.703076368487546vmin currentColor;
}
.ball:nth-child(2) {
    top: 42%;
    left: 2%;
    animation-duration: 53s;
    animation-delay: -29s;
    transform-origin: -19vw 21vh;
    box-shadow: -40vmin 0 5.17594621519026vmin currentColor;
}
.ball:nth-child(3) {
    top: 28%;
    left: 18%;
    animation-duration: 49s;
    animation-delay: -8s;
    transform-origin: -22vw 3vh;
    box-shadow: 40vmin 0 5.248179047256236vmin currentColor;
}
.ball:nth-child(4) {
    top: 50%;
    left: 79%;
    animation-duration: 26s;
    animation-delay: -21s;
    transform-origin: -17vw -6vh;
    box-shadow: 40vmin 0 5.279749632220298vmin currentColor;
}
.ball:nth-child(5) {
    top: 46%;
    left: 15%;
    animation-duration: 36s;
    animation-delay: -40s;
    transform-origin: 4vw 0vh;
    box-shadow: -40vmin 0 5.964309466052033vmin currentColor;
}
.ball:nth-child(6) {
    top: 77%;
    left: 16%;
    animation-duration: 31s;
    animation-delay: -10s;
    transform-origin: 18vw 4vh;
    box-shadow: 40vmin 0 5.178483653434181vmin currentColor;
}
.ball:nth-child(7) {
    top: 22%;
    left: 17%;
    animation-duration: 55s;
    animation-delay: -6s;
    transform-origin: 1vw -23vh;
    box-shadow: -40vmin 0 5.703026794398318vmin currentColor;
}
.ball:nth-child(8) {
    top: 41%;
    left: 47%;
    animation-duration: 43s;
    animation-delay: -28s;
    transform-origin: 25vw -3vh;
    box-shadow: 40vmin 0 5.196265905749415vmin currentColor;
}
