/* Reset i osnovni stilovi */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #f5f5f5;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: #3498db;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.nav-user-brand {
    display: flex;
    align-items: center;
}

.nav-subjects {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.subject-link {
    color: white;
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 50%;
    font-size: 1.5rem;
    transition: all 0.3s;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.subject-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.4);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-user-info {
    display: flex;
    align-items: center;
}

.nav-user-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    transition: all 0.3s;
}

.nav-user-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

/* Predmeti navbar */
.subjects-menu {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
}

.subject-link {
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.subject-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
}

.nav-group:last-child {
    margin-left: auto;
}

.nav-user {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
}

.nav-user-name {
    color: white;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    font-size: 0.9rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.nav-logout {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.nav-logout:hover {
    background: rgba(231, 76, 60, 0.3);
    border-color: rgba(231, 76, 60, 0.5);
}

/* Hamburger menu */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Flash messages */
.flash-messages {
    margin: 1rem 0;
}

.flash-message {
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 4px;
    font-weight: 500;
}

.flash-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Hero section */
.hero-section {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    margin-bottom: 2rem;
    border-radius: 8px;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-input, .form-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #3498db;
}

.form-errors {
    margin-top: 0.5rem;
}

.error {
    color: #e74c3c;
    font-size: 0.9rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-full {
    width: 100%;
}

/* Auth pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem 0;
}

.auth-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-links {
    text-align: center;
    margin-top: 1rem;
}

.auth-links a {
    color: #3498db;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Welcome section */
.welcome-section {
    text-align: center;
    padding: 2rem 0;
}

.welcome-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.welcome-section p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #7f8c8d;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.feature h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #3498db;
}

/* Quiz selection */
.quiz-selection {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.quiz-selection h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

/* Topics grid */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.topic-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.topic-card:hover {
    transform: translateY(-2px);
}

.topic-card h3 {
    color: #3498db;
    margin-bottom: 0.5rem;
}

/* Quiz interface */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    margin-bottom: 2rem;
}

.quiz-progress {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: #3498db;
    transition: width 0.3s;
}

.progress-text {
    font-weight: 500;
    color: #7f8c8d;
}

.question-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.question-text {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: #2c3e50;
    line-height: 1.5;
}

.options {
    margin-bottom: 2rem;
}

.option {
    display: block;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.option:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.option input[type="radio"] {
    margin-right: 1rem;
    transform: scale(1.2);
}

.option input[type="radio"]:checked + .option-text {
    color: #3498db;
    font-weight: 500;
}

.option-text {
    font-size: 1.1rem;
    line-height: 1.4;
}

.quiz-actions {
    text-align: center;
}

/* Results */
.results-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.results-header h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.score-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.score-circle {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.score-number {
    font-size: 2rem;
    font-weight: bold;
}

.score-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.score-details {
    flex: 1;
}

.score-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.score-value {
    font-weight: 500;
    color: #3498db;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.congratulations, .good-result, .encouragement {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.congratulations {
    border-left: 4px solid #27ae60;
}

.good-result {
    border-left: 4px solid #f39c12;
}

.encouragement {
    border-left: 4px solid #e74c3c;
}

/* Profile */
.profile-container {
    max-width: 1000px;
    margin: 0 auto;
}

.profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #7f8c8d;
    font-weight: 500;
}

.topic-stats {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.topic-stats h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.topic-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.topic-stat-card {
    padding: 1rem;
    border: 1px solid #ecf0f1;
    border-radius: 4px;
}

.topic-stat-card h4 {
    color: #3498db;
    margin-bottom: 0.5rem;
}

.topic-stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.recent-attempts {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.recent-attempts h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.attempts-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #2c3e50;
}

.score-cell {
    font-weight: 500;
}

.score-good {
    color: #27ae60;
}

.score-needs-improvement {
    color: #e74c3c;
}

/* Attempt rows hover effect */
.attempt-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.attempt-row:hover {
    background-color: #f8f9fa;
}

.profile-actions {
    text-align: center;
    margin: 2rem 0;
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content p {
    opacity: 0.8;
}

/* Quick start section */
.quick-start-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 2rem 0;
    text-align: center;
}

.quick-start-section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.quick-start-form {
    max-width: 500px;
    margin: 0 auto;
}

.quick-start-form .form-group {
    margin-bottom: 1.5rem;
}

.quick-start-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    text-align: left;
}

.quick-start-form select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.quick-start-form select:hover {
    border-color: #3498db;
}

.quick-start-form select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Subject cards */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.subject-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.subject-card:hover {
    transform: translateY(-2px);
}

.subject-card h3 {
    color: #3498db;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.subject-card p {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.subject-actions {
    margin-top: 1rem;
}

/* Button disabled state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    background-color: #3498db;
    transform: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-subjects {
        display: none;
    }
    
    
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        background: #3498db;
        width: 100%;
        top: 100%;
        left: 0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        z-index: 1000;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    
    .nav-menu .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        width: 100%;
        text-align: center;
    }
    
    .nav-menu .nav-link:last-child {
        border-bottom: none;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .auth-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .score-card {
        flex-direction: column;
        text-align: center;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
}

/* Review page styles */
.review-container {
    max-width: 1000px;
    margin: 0 auto;
}

.review-header {
    text-align: center;
    margin-bottom: 2rem;
}

.review-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.review-subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.review-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 120px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #7f8c8d;
    font-weight: 500;
}

.review-questions {
    margin-bottom: 3rem;
}

.review-item {
    background: white;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s;
}

.review-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.review-item.correct-answer {
    border-left: 4px solid #27ae60;
}

.review-item.incorrect-answer {
    border-left: 4px solid #e74c3c;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #ecf0f1;
}

.question-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
}

.question-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.status-icon.correct {
    background-color: #27ae60;
    color: white;
}

.status-icon.incorrect {
    background-color: #e74c3c;
    color: white;
}

.status-text {
    font-weight: 500;
    font-size: 0.9rem;
}

.status-text:has(.status-icon.correct) {
    color: #27ae60;
}

.status-text:has(.status-icon.incorrect) {
    color: #e74c3c;
}

.question-content {
    padding: 2rem;
}

.question-text {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    line-height: 1.5;
}

.options-review {
    margin-bottom: 1.5rem;
}

.option {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border: 2px solid #ecf0f1;
    transition: all 0.3s;
}

.option.correct-option {
    background-color: #d4edda;
    border-color: #27ae60;
    color: #155724;
}

.option.user-answer {
    background-color: #f8d7da;
    border-color: #e74c3c;
    color: #721c24;
}

.option-letter {
    font-weight: bold;
    margin-right: 1rem;
    min-width: 20px;
}

.option-text {
    flex: 1;
    line-height: 1.4;
}

.correct-mark {
    color: #27ae60;
    font-weight: bold;
    font-size: 1.2rem;
}

.user-answer-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 4px solid #e74c3c;
}

.user-answer-info p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.user-answer-info strong {
    color: #2c3e50;
}

.explanation {
    background: #e8f4fd;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    margin-top: 1rem;
}

.explanation h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.explanation p {
    color: #2c3e50;
    line-height: 1.5;
    margin: 0;
}

.review-actions {
    text-align: center;
    margin: 3rem 0;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive adjustments for review page */
@media (max-width: 768px) {
    .review-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        width: 100%;
        max-width: 200px;
    }
    
    .question-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .review-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .review-actions .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Ranking page styles */
.ranking-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

.ranking-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ranking-header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.ranking-subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.ranking-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn.filter-btn {
    align-self: flex-start;
    margin-top: 1.5rem; /* Dugme u nivou sa dropdown poljima */
    height: 38px; /* Ista visina kao select elementi */
    background-color: #3498db !important; /* Plava pozadina - !important da prepiše btn-primary */
    color: white !important; /* Beli tekst */
    border: 1px solid #2980b9 !important; /* Tamnija plava border */
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn.filter-btn:hover {
    background-color: #2980b9 !important; /* Tamnija plava na hover */
    border-color: #1f5f8b !important;
}


.filter-group label {
    font-weight: 600;
    color: #2c3e50;
}

/* Profile filters */
.profile-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-filters .filter-group label {
    font-weight: 600;
    color: #2c3e50;
}

.profile-filters .filter-group select {
    padding: 0.5rem;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.profile-filters .filter-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* Responsive design za filtere */
@media (max-width: 768px) {
    .ranking-filters {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .btn.filter-btn {
        width: 100%;
        margin-top: 1rem;
    }
}

.filter-group select {
    padding: 0.5rem;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
    background: white;
}

.filter-group select:focus {
    outline: none;
    border-color: #3498db;
}

.ranking-sections {
    display: grid;
    gap: 2rem;
}

.ranking-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ranking-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: transform 0.2s;
}

.ranking-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.rank-position {
    font-size: 1.5rem;
    font-weight: bold;
    margin-right: 1rem;
    min-width: 3rem;
    text-align: center;
}

.user-info {
    flex: 1;
}

.username {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.user-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.average-score {
    font-weight: 600;
    color: #27ae60;
}

.attempts-count {
    color: #7f8c8d;
}

.score-badge {
    background: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
}

.score-badge .score-value {
    color: white !important;
}

.topic-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.topic-stat-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
}

.topic-stat-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

.stat-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-label {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.metric-value {
    font-weight: 600;
    color: #2c3e50;
}

.ranking-actions {
    text-align: center;
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive adjustments for ranking page */
@media (max-width: 768px) {
    .ranking-filters {
        flex-direction: column;
        gap: 1rem;
    }
    
    .ranking-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .user-stats {
        justify-content: center;
    }
    
    .topic-stats {
        grid-template-columns: 1fr;
    }
    
    .ranking-actions {
        flex-direction: column;
    }
}

/* Study page styles */
.study-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

.study-header {
    text-align: center;
    margin-bottom: 2rem;
}

.study-header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.study-subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.study-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    display: inline-block;
}

.question-count {
    font-weight: 600;
    color: #2c3e50;
    margin-right: 1rem;
}

.unknown-count {
    font-weight: 600;
    color: #8b4513;
    background: #ffdfba;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    margin-right: 0.5rem;
}

.mixed-count {
    font-weight: 600;
    color: #4a2c5a;
    background: #e6d4f5;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    margin-right: 0.5rem;
}

.new-count {
    font-weight: 600;
    color: #2c3e50;
    background: #f8f9fa;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    margin-right: 0.5rem;
}

.known-count {
    font-weight: 600;
    color: #2d5a3d;
    background: #b8e6b8;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    margin-right: 0.5rem;
}

/* Category filters */
.category-filters {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.filter-label {
    font-weight: 600;
    color: #2c3e50;
    margin-right: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #bdc3c7;
    background: white;
    color: #2c3e50;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #f8f9fa;
    border-color: #3498db;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.filter-btn.active:hover {
    background: #2980b9;
    border-color: #2980b9;
}

/* Study instructions */
.study-instructions {
    background: #e8f4fd;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    margin: 1rem 0 2rem 0;
    text-align: center;
}

.study-instructions p {
    margin: 0;
    color: #2c3e50;
    font-size: 0.95rem;
}

/* Flashcard grid */
.flashcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 1rem 0;
}

/* Flashcard styles */
.flashcard {
    background-color: transparent;
    width: 100%;
    height: 250px;
    perspective: 1000px;
    cursor: pointer;
}

/* Mobilne kartice - veća visina */
@media (max-width: 768px) {
    .flashcard {
        height: auto;
        min-height: 200px;
    }
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.3s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.flashcard-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.flashcard-back {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    transform: rotateY(180deg);
}

/* Known cards - soft green */
.flashcard.known .flashcard-front {
    background: linear-gradient(135deg, #a8e6cf 0%, #88d8a3 100%);
    color: #2d5a3d;
}

.flashcard.known .flashcard-back {
    background: linear-gradient(135deg, #b8e6b8 0%, #a8e6a8 100%);
    color: #2d5a3d;
    transform: rotateY(180deg);
}

/* Unknown cards - soft orange */
.flashcard.unknown .flashcard-front {
    background: linear-gradient(135deg, #ffb3ba 0%, #ffdfba 100%);
    color: #8b4513;
}

.flashcard.unknown .flashcard-back {
    background: linear-gradient(135deg, #ffdfba 0%, #ffb3ba 100%);
    color: #8b4513;
    transform: rotateY(180deg);
}

/* Mixed cards - soft purple */
.flashcard.mixed .flashcard-front {
    background: linear-gradient(135deg, #d4a5f5 0%, #c7a2f0 100%);
    color: #4a2c5a;
}

.flashcard.mixed .flashcard-back {
    background: linear-gradient(135deg, #e6d4f5 0%, #d4a5f5 100%);
    color: #4a2c5a;
    transform: rotateY(180deg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

.card-number {
    font-weight: bold;
    font-size: 1.1rem;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.difficulty-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.answer-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

.status-badge.unknown {
    background: rgba(255,255,255,0.3);
    color: #8b4513;
}

.status-badge.mixed {
    background: rgba(255,255,255,0.3);
    color: #4a2c5a;
}

.status-badge.known {
    background: rgba(255,255,255,0.3);
    color: #2d5a3d;
}

.status-badge.new {
    background: rgba(255,255,255,0.3);
    color: #2c3e50;
}

.card-content {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    overflow-y: auto;
}

/* Mobilni sadržaj */
@media (max-width: 768px) {
    .card-content {
        padding: 0.75rem;
        justify-content: flex-start;
        overflow-y: visible;
    }
}

.question-text {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

.flip-hint {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.explanation h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.explanation p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

/* Mobilni objašnjenja */
@media (max-width: 768px) {
    .explanation h4 {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .explanation p {
        font-size: 0.8rem;
        line-height: 1.3;
    }
}

.no-explanation {
    text-align: center;
    font-style: italic;
    opacity: 0.8;
}

/* Hover effects - samo za desktop */
@media (hover: hover) {
    .flashcard:hover {
        transform: translateY(-2px);
        transition: transform 0.2s;
    }

    .flashcard:hover .flashcard-inner {
        transform: scale(1.02);
    }
}

/* Tap effects za mobilne uređaje */
.flashcard:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-number {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.difficulty-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-badge.lako {
    background: #d4edda;
    color: #155724;
}

.difficulty-badge.srednje {
    background: #fff3cd;
    color: #856404;
}

.difficulty-badge.teško {
    background: #f8d7da;
    color: #721c24;
}

.question-text {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.options-display {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.option {
    padding: 1rem;
    border-radius: 6px;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.option.correct-option {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.option-letter {
    font-weight: bold;
    color: #6c757d;
    min-width: 20px;
}

.option-text {
    flex: 1;
    line-height: 1.4;
}

.correct-answer {
    background: #d4edda;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #28a745;
    margin-bottom: 1rem;
    color: #155724;
}

.explanation {
    background: #e8f4fd;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.explanation h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.explanation p {
    color: #2c3e50;
    line-height: 1.5;
    margin: 0;
}

.no-explanation {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #6c757d;
    color: #6c757d;
    font-style: italic;
}

.study-actions {
    text-align: center;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Topic actions in index */
.topic-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.btn-study {
    background: #28a745;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-study:hover {
    background: #218838;
    color: white;
    text-decoration: none;
}

.btn-quiz {
    background: #007bff;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-quiz:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

/* Responsive adjustments for study page */
@media (max-width: 768px) {
    .study-container {
        padding: 1rem 0;
    }
    
    .study-item {
        padding: 1rem;
    }
    
    .question-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .study-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .topic-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .flashcards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .flashcard {
        height: auto;
        min-height: 180px;
    }
    
    .card-header {
        padding: 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .card-number {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.9rem;
    }
    
    .difficulty-badge, .answer-badge, .status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .card-content {
        padding: 0.75rem;
        min-height: 120px;
    }
    
    .question-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .explanation h4 {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .explanation p {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .flip-hint {
        font-size: 0.8rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    
    .category-filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .filter-btn {
        width: 100%;
        text-align: center;
    }
}

/* Stilovi za top korisnike po temama */
.top-users-list {
    margin-top: 1rem;
}

.user-rank-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.rank-number {
    font-weight: bold;
    color: #007bff;
    margin-right: 0.5rem;
    min-width: 2rem;
}

.username {
    font-weight: 600;
    color: #333;
    flex-grow: 1;
    margin-right: 1rem;
}

.user-score {
    font-weight: bold;
    color: #28a745;
    margin-right: 0.5rem;
}

.user-attempts {
    color: #6c757d;
    font-size: 0.9rem;
}

.no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 1rem;
}

/* Stilovi za klikabilne kartice */
.clickable-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.clickable-card:active {
    transform: translateY(0);
}

