/* Buttons */
button, .button {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 24px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

button:hover, .button:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

button:disabled, .button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

button:disabled:hover, .button:disabled:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

/* Primary Button */
.button-primary, .submit-button {
    background: var(--accent-color);
    color: var(--bg-color);
    border: 1px solid var(--accent-color);
    font-weight: 600;
}

.button-primary:hover, .submit-button:hover:not(:disabled) {
    background: var(--bg-color);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.submit-button:disabled {
    background: var(--border-color);
    color: var(--text-color);
    border-color: var(--border-color);
    opacity: 0.6;
}

/* Secondary Button */
.button-secondary {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

.button-secondary:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

/* Filter Buttons */
.filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 16px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
    padding: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
    width: 100%;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

input:disabled, textarea:disabled, select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--image-placeholder);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Form Labels */
label {
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
    color: var(--text-color);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Form Messages */
.form-message {
    padding: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.form-message.success {
    background: #e8f5e8;
    border-color: #4caf50;
    color: #2e7d32;
}

.form-message.error {
    background: #ffeaea;
    border-color: #f44336;
    color: #c62828;
}

[data-theme="dark"] .form-message.success {
    background: #1b3b1b;
    border-color: #4caf50;
    color: #81c784;
}

[data-theme="dark"] .form-message.error {
    background: #3b1b1b;
    border-color: #f44336;
    color: #ef5350;
}

/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    padding: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    background: var(--image-placeholder);
}

.card-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
}

.card-subtitle {
    font-size: 0.9rem;
    opacity: 0.7;
    margin: 4px 0 0 0;
}

.card-content {
    line-height: 1.6;
}

.card-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Links */
.link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.link:hover {
    opacity: 0.7;
}

.link.underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.link.underline:hover::after {
    width: 100%;
}

.capability-link {
    color: var(--accent-color);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
}

.capability-link:hover {
    opacity: 0.7;
}

.work-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 8px 16px;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
}

.work-link:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 20px;
    background: var(--image-placeholder);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.badge.primary {
    background: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

/* Loading States */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.7;
}

/* Progress Bar */
.progress {
    width: 100%;
    height: 4px;
    background: var(--image-placeholder);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    color: var(--bg-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.tooltip:hover::before {
    opacity: 1;
}

/* Dividers */
.divider {
    width: 100%;
    height: 1px;
    background: var(--border-color);
    margin: 40px 0;
}

.divider.vertical {
    width: 1px;
    height: 100%;
    margin: 0 20px;
}

/* Status Indicators */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
}

.status.active .status-dot {
    background: #4caf50;
}

.status.pending .status-dot {
    background: #ff9800;
}

.status.inactive .status-dot {
    background: #f44336;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}