/* Import CSS Variables */
@import url('variables.css');

/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body.index-page {
  color: #ffffff;
}

.form-hint {
  color: #6b6b6b;            /* siva */
  font-size: 0.85rem;        /* manji font */
  margin-top: 6px;
}

.pw-status {
  font-size: 0.85rem;
  margin-top: 6px;
  line-height: 1;
}

/* boje stanja */
.pw-status.weak { color: #d9534f; }   /* crvena */
.pw-status.ok   { color: #28a745; }   /* zelena */

/* traka za ukazivanje */
.pw-bar {
  width: 100%;
  height: 6px;
  background: #ededed;
  border-radius: 6px;
  margin-top: 6px;
  overflow: hidden;
}
.pw-fill {
  width: 0%;
  height: 100%;
  background: #d9534f; /* start crvena */
  transition: width 150ms ease, background 150ms ease;
}


/* Reset and Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.required {
    color: red;
    font-weight: bold;
    margin-left: 2px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    font-weight: var(--font-weight-normal);
    background-color: #f2f4f7; /* bijela */
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-headings);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-4);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-base); }
h6 { font-size: var(--font-size-sm); }

p {
    margin-bottom: var(--space-4);
    line-height: var(--line-height-relaxed);
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover, a:focus {
    color: var(--primary-hover);
    outline: none;
}

a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Layout */
.container {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 0 var(--space-5);
    width: 100%;
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-4);
    }
}

/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--input-padding-y) var(--space-4);
    border: var(--input-border-width) solid transparent;
    border-radius: var(--input-border-radius);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-tight);
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-base);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    min-height: var(--input-height);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus:not(:disabled) {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    border-color: var(--input-border-color);
}

.btn-secondary:hover:not(:disabled),
.btn-secondary:focus:not(:disabled) {
    background-color: var(--bg-light);
    border-color: var(--text-muted);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
    min-height: 2rem;
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-base);
    min-height: 3rem;
}

.btn:focus-visible {
    outline: var(--input-focus-ring-width) solid var(--input-focus-ring-color);
    outline-offset: 2px;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: var(--space-8) 0;
    min-height: calc(100vh - var(--header-height));
}

/* Form Components */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
}

.form-label.required::after {
    content: ' *';
    color: var(--status-danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    min-height: var(--input-height);
    padding: var(--input-padding-y) var(--input-padding-x);
    border: var(--input-border-width) solid var(--input-border-color);
    border-radius: var(--input-border-radius);
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--input-focus-border-color);
    box-shadow: 0 0 0 var(--input-focus-ring-width) var(--input-focus-ring-color);
    outline: none;
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background-color: var(--bg-light);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--status-danger);
    box-shadow: 0 0 0 var(--input-focus-ring-width) rgba(220, 53, 69, 0.1);
}

.form-textarea {
    min-height: calc(var(--input-height) * 2.5);
    resize: vertical;
}

.form-select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23666" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    background-size: 16px;
    padding-right: var(--space-8);
    appearance: none;
}

/* Form Error Messages */
.field-error {
    display: none;
    margin-top: var(--space-1);
    color: var(--status-danger);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.error-message,
.success-message,
.info-message {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.error-message {
    background-color: #fef2f2;
    color: var(--status-danger);
    border: 1px solid #fecaca;
}

.success-message {
    background-color: #f0fdf4;
    color: var(--status-success);
    border: 1px solid #bbf7d0;
}

.info-message {
    background-color: #eff6ff;
    color: var(--status-info);
    border: 1px solid #bfdbfe;
}

/* Form Loading States */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    color: var(--text-white);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

        .dashboard-container {
            padding: 20px;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 0 6px rgba(0,0,0,0.1);
            margin-bottom: 20px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }
        th, td {
            padding: 10px;
            border: 1px solid #ddd;
            vertical-align: top;
            text-align: left;
        }
        th {
            background-color: #f4f4f4;
            cursor: pointer;
        }
        th a {
            text-decoration: none;
            color: inherit;
            display: block;
        }
        th a:hover {
            color: #007bff;
        }
        .status-pending { color: orange; font-weight: bold; }
        .status-accepted { color: green; font-weight: bold; }
        .status-rejected { color: red; font-weight: bold; }
        .status-in_progress { color: #007bff; font-weight: bold; } 
        .status-closed { color: grey; font-weight: bold; } 
        .no-offers-message {
            text-align: center;
            padding: 20px;
            background: #e0f2f7;
            border: 1px solid #b3e5fc;
            border-radius: 6px;
            color: #01579b;
        }
        .action-buttons button {
            margin-right: 5px;
            padding: 8px 12px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        .action-buttons .btn-success { background-color: #28a745; color: white; }
        .action-buttons .btn-danger { background-color: #dc3545; color: white; }

#notifications-tab-content p.unread {
    background-color: #d0e7ff; 
    font-weight: bold;
    padding: 5px;
    border-radius: 4px;
}

.notifications-tab-count,
.messages-tab-count,
.admin-tab-count,
.total-unread-count {
    background-color: #ff3b3b; 
    color: white;
    border-radius: 50%;
    padding: 2px 7px;
    font-size: 0.8em;
    font-weight: bold;
    position: absolute;
    top: -5px;
    right: -5px;
    display: inline-block;
    min-width: 20px;
    text-align: center;
}

@media (max-width: 480px) {
    .btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }
}