/* Planning Poker Styles */

:root {
    --primary-color: #7b68ee;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #333;
    --border-color: #e0e0e0;
    --hover-color: #f0f0f0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Cards */
.card, .task-card, .participants-card, .results-section, .summary-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2em;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
}

/* Forms */
.form-section {
    margin-top: 30px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.url-input, .username-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 8px;
    transition: border-color 0.3s;
}

.url-input:focus, .username-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

small {
    display: block;
    color: #666;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 10px;
}

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

.btn-primary:hover:not(:disabled) {
    background: #6952d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.4);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #45a049;
}

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

.btn-secondary {
    background: #666;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #555;
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.navigation-buttons .btn {
    flex: 1;
    margin: 0;
}

/* Progress Indicator */
.progress-indicator {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: var(--hover-color);
    border-radius: 8px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 16px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Error */
.error-message {
    background: #ffebee;
    color: var(--danger-color);
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid var(--danger-color);
}

/* Info Box */
.info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.info-box h3 {
    color: #1976d2;
    margin-bottom: 15px;
}

.info-box ol {
    margin-left: 20px;
}

.info-box li {
    margin-bottom: 8px;
}

/* Session Header */
.session-header {
    text-align: center;
    margin-bottom: 30px;
}

.session-info {
    margin-top: 10px;
}

.session-link {
    display: inline-block;
    background: var(--hover-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 14px;
}

.session-link:hover {
    background: var(--border-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* Task Card */
.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.task-progress {
    color: #666;
    font-size: 14px;
}

.task-clickup-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s;
    background: rgba(123, 104, 238, 0.1);
}

.task-clickup-link:hover {
    background: rgba(123, 104, 238, 0.2);
    transform: translateY(-1px);
}

.task-clickup-link svg {
    width: 16px;
    height: 16px;
}

.task-name {
    font-size: 1.5em;
    color: var(--text-color);
    margin-bottom: 20px;
}

/* Task Content Layout - Description links, Comments rechts */
.task-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin-top: 20px;
}

.task-description-col h4,
.task-comments-col h4 {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.task-description {
    color: #666;
    line-height: 1.8;
    white-space: pre-wrap;
}

.task-comments {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.task-comments::-webkit-scrollbar {
    width: 6px;
}

.task-comments::-webkit-scrollbar-track {
    background: var(--hover-color);
    border-radius: 3px;
}

.task-comments::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.task-comments::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.comment-item {
    background: var(--hover-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.comment-user {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.comment-date {
    font-size: 12px;
    color: #999;
}

.comment-text {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.no-comments {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

/* Responsive für schmale Bildschirme */
@media (max-width: 900px) {
    .task-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .task-comments-col {
        border-top: 1px solid var(--border-color);
        padding-top: 20px;
    }
}

/* Voting Section */
.voting-section {
    margin: 30px 0;
}

.voting-section h3 {
    margin-bottom: 20px;
    text-align: center;
}

/* Progress Indicator */
.voting-progress {
    margin: 20px 0;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.story-points {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.point-btn {
    width: 70px;
    height: 70px;
    border: 3px solid var(--border-color);
    background: white;
    border-radius: 12px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.point-btn:hover {
    background: var(--hover-color);
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.point-btn.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.your-vote {
    text-align: center;
    margin-top: 20px;
    font-size: 18px;
    color: var(--primary-color);
    font-weight: 600;
}

/* Results */
.votes-display {
    margin: 20px 0;
}

.vote-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--hover-color);
    border-radius: 8px;
    margin-bottom: 10px;
}

.vote-item .username {
    flex: 1;
    font-weight: 600;
}

.vote-item .points {
    font-size: 20px;
    font-weight: bold;
    margin-right: 10px;
}

.vote-bar {
    flex: 2;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.vote-bar-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.5s;
}

.stats-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.stats-display h4 {
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-bottom: none;
}

.refinement-warning {
    background: #fff3cd;
    border-left: 4px solid var(--warning-color);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    color: #856404;
}

.next-task-hint {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-style: italic;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Participants */
.participants-list {
    list-style: none;
}

.participant-item {
    padding: 10px;
    background: var(--hover-color);
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.participant-item.voted::before {
    content: '✅';
    margin-right: 10px;
}

.participant-item.waiting::before {
    content: '⏳';
    margin-right: 10px;
}

/* Summary */
.summary-content {
    margin: 20px 0;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--hover-color);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-card .number {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-card .label {
    color: #666;
    margin-top: 5px;
}

/* Detailed Results */
.detailed-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}

.result-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.result-card.needs-refine {
    border-left: 6px solid var(--warning-color);
    background: #fff9e6;
}

.result-task-name {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 18px;
}

.result-votes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.result-vote-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--hover-color);
    padding: 8px 12px;
    border-radius: 6px;
}

.result-username {
    font-size: 14px;
    color: #666;
}

.result-points {
    font-weight: bold;
    font-size: 18px;
    color: var(--primary-color);
}

.result-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.result-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.result-stat span {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.result-stat strong {
    font-size: 16px;
}

.refinement-badge {
    background: var(--warning-color);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    margin-top: 10px;
}

.task-list-summary {
    margin-top: 20px;
}

.task-summary-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
}

.task-summary-item .task-name {
    font-weight: 600;
    font-size: 16px;
}

.task-summary-item .points {
    color: var(--primary-color);
    font-weight: bold;
}

.task-summary-item.needs-refine {
    border-left: 4px solid var(--warning-color);
    background: #fff3cd;
}

.finalize-status {
    margin-top: 20px;
}

.finalize-status.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--success-color);
}

.finalize-status.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--danger-color);
}

/* Responsive */
@media (max-width: 768px) {
    .story-points {
        gap: 8px;
    }
    
    .point-btn {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }
    
    .container {
        padding: 10px;
    }
    
    .card, .task-card, .participants-card {
        padding: 20px;
    }
}
