/**
 * LinkedIn URL Optimizer - Styles
 * Version: 1.0.0
 * Author: Ihr Name
 */

/* ==========================================================================
   Container & Layout
   ========================================================================== */

.linkedin-optimizer-container {
    max-width: 600px;
    margin: 20px 0;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Header
   ========================================================================== */

.optimizer-title {
    color: #0077b5;
    margin: 0 0 10px 0;
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.3;
}

.optimizer-description {
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.6;
    font-size: 14px;
}

/* ==========================================================================
   Form
   ========================================================================== */

.optimizer-form {
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 0;
}

.url-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    transition: all 0.3s ease;
    background: #fff;
}

.url-input:focus {
    outline: none;
    border-color: #0077b5;
    box-shadow: 0 0 0 3px rgba(0, 119, 181, 0.1);
}

.url-input::placeholder {
    color: #999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.analyze-btn {
    padding: 12px 24px;
    background: #0077b5;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 140px;
    text-align: center;
}

.analyze-btn:hover {
    background: #005885;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 119, 181, 0.3);
}

.analyze-btn:active {
    transform: translateY(0);
}

.analyze-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loader {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.5; 
    }
}

/* ==========================================================================
   Result Container
   ========================================================================== */

.result-container {
    margin-top: 20px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Result Types */
.result-success,
.result-warning,
.result-error {
    padding: 16px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 4px solid;
}

.result-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.result-success strong {
    color: #0d4721;
}

.result-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.result-warning strong {
    color: #533f03;
}

.result-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.result-error strong {
    color: #491217;
}

/* ==========================================================================
   Suggestions List
   ========================================================================== */

.suggestions-list {
    margin-top: 20px;
}

.suggestions-list h4 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
}

.suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border: 1px solid #ddd;
    border-left: 4px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.suggestion-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

/* Availability States */
.suggestion-item.available {
    border-left-color: #28a745;
    background: #f8fff9;
}

.suggestion-item.unavailable {
    border-left-color: #dc3545;
    background: #fff5f5;
    opacity: 0.8;
}

.suggestion-item.checking {
    border-left-color: #ffc107;
    background: #fffef5;
}

/* Suggestion Content */
.suggestion-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0; /* Für text-overflow */
}

.suggestion-url {
    font-family: 'Courier New', Courier, monospace;
    color: #0077b5;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    word-break: break-all;
    transition: color 0.2s ease;
}

.suggestion-url:hover {
    text-decoration: underline;
    color: #005885;
}

.suggestion-description {
    font-size: 11px;
    color: #666;
    font-style: italic;
}

/* Status Badges */
.suggestion-status {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 0;
}

.suggestion-status.available {
    color: #28a745;
}

.suggestion-status.unavailable {
    color: #dc3545;
}

.suggestion-status.checking {
    color: #ffc107;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */

.suggestion-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.copy-btn,
.check-btn {
    padding: 7px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-btn {
    background: #28a745;
    color: white;
}

.copy-btn:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.check-btn {
    background: #007bff;
    color: white;
}

.check-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.check-btn:active {
    transform: translateY(0);
}

.check-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */

.availability-loader {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 5px;
    vertical-align: middle;
}

@keyframes spin {
    0% { 
        transform: rotate(0deg); 
    }
    100% { 
        transform: rotate(360deg); 
    }
}

/* ==========================================================================
   Tips Box
   ========================================================================== */

.tips-box {
    background: #e7f3ff;
    border-left: 4px solid #0077b5;
    padding: 16px;
    margin-top: 20px;
    border-radius: 5px;
}

.tips-box h4 {
    margin: 0 0 12px 0;
    color: #0077b5;
    font-size: 15px;
    font-weight: 600;
}

.tips-box ul {
    margin: 0;
    padding-left: 20px;
}

.tips-box li {
    color: #333;
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 14px;
}

.tips-box li:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Helper Text
   ========================================================================== */

.suggestions-list p:last-child {
    margin: 15px 0 0 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.suggestions-list p em {
    font-style: italic;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .linkedin-optimizer-container {
        padding: 20px 15px;
        margin: 15px 0;
    }
    
    .optimizer-title {
        font-size: 1.3em;
    }
    
    .input-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    
    .analyze-btn {
        width: 100%;
        min-width: auto;
    }
    
    .suggestion-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }
    
    .suggestion-content {
        width: 100%;
    }
    
    .suggestion-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .copy-btn,
    .check-btn {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .linkedin-optimizer-container {
        padding: 15px 12px;
    }
    
    .optimizer-title {
        font-size: 1.2em;
    }
    
    .optimizer-description {
        font-size: 13px;
    }
    
    .url-input {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .analyze-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .suggestion-url {
        font-size: 12px;
    }
    
    .tips-box {
        padding: 12px;
    }
    
    .tips-box li {
        font-size: 13px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .linkedin-optimizer-container {
        border: 1px solid #ccc;
        box-shadow: none;
    }
    
    .analyze-btn,
    .copy-btn,
    .check-btn {
        display: none;
    }
    
    .suggestion-item {
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   Dark Mode Support (optional)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .linkedin-optimizer-container {
        background: #1e1e1e;
        border-color: #333;
        color: #e0e0e0;
    }
    
    .optimizer-title {
        color: #4da3ff;
    }
    
    .optimizer-description {
        color: #b0b0b0;
    }
    
    .url-input {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .url-input:focus {
        border-color: #4da3ff;
        box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.2);
    }
    
    .suggestion-item {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .suggestion-item.available {
        background: #1a2e1a;
    }
    
    .suggestion-item.unavailable {
        background: #2e1a1a;
    }
    
    .suggestion-url {
        color: #4da3ff;
    }
    
    .tips-box {
        background: #1a2530;
        border-color: #4da3ff;
    }
    
    .tips-box h4 {
        color: #4da3ff;
    }
    
    .tips-box li {
        color: #e0e0e0;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* Focus States für Tastatur-Navigation */
.url-input:focus-visible,
.analyze-btn:focus-visible,
.copy-btn:focus-visible,
.check-btn:focus-visible,
.suggestion-url:focus-visible {
    outline: 3px solid #0077b5;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .linkedin-optimizer-container {
        border: 2px solid currentColor;
    }
    
    .url-input,
    .suggestion-item {
        border: 2px solid currentColor;
    }
    
    .analyze-btn,
    .copy-btn,
    .check-btn {
        border: 2px solid currentColor;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-0 {
    margin-bottom: 0;
}

/* ==========================================================================
   WordPress Editor Compatibility
   ========================================================================== */

/* Stelle sicher, dass Styles im Block-Editor funktionieren */
.wp-block .linkedin-optimizer-container {
    margin-left: 0;
    margin-right: 0;
}

/* ==========================================================================
   End of Styles
   ========================================================================== */