/* Build Status and History Styles */
.build-history-container {
    margin-top: 40px;
}

.build-history-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.history-list {
    max-height: 600px;
    overflow-y: auto;
}

.history-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-app-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.history-date {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.history-build-id {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 15px;
}

.history-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.history-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.history-status-dot.success {
    background: #10b981;
}

.history-status-dot.failed {
    background: #ef4444;
}

.history-status-text {
    font-weight: 500;
    color: #ffffff;
}

.history-downloads {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.history-downloads h4 {
    margin: 0 0 15px 0;
    color: #10b981;
    font-size: 1.1rem;
}

.history-download-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.history-download-btn {
    flex: 1;
    min-width: 180px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-align: center;
}

.history-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, #059669, #047857);
}

.history-download-btn:disabled,
.history-download-btn[href="#"] {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

.build-status-container {
    margin-top: 40px;
}

.build-status-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.build-item {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(100, 100, 100, 0.3);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.build-item:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(100, 100, 100, 0.4);
}

.build-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    color: #ffffff;
}

.build-id {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 15px;
}

.build-status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fbbf24;
    animation: pulse 2s infinite;
}

.status-dot.building {
    background: #3b82f6;
}

.status-dot.success {
    background: #10b981;
    animation: none;
}

.status-dot.failed {
    background: #ef4444;
    animation: none;
}

.status-text {
    font-weight: 500;
    color: #ffffff;
}

.build-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.build-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 3px;
}

.build-actions {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.build-actions h4 {
    text-align: center;
    margin-bottom: 20px;
    color: #10b981;
    font-size: 1.2rem;
}

.download-links {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.download-btn {
    flex: 1;
    min-width: 200px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 12px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-align: center;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, #059669, #047857);
}

.download-btn:disabled,
.download-btn[href="#"] {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

.android-btn {
    background: linear-gradient(135deg, #34d399, #10b981);
}

.android-btn:hover {
    background: linear-gradient(135deg, #10b981, #059669);
}

.ios-btn {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.ios-btn:hover {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.download-icon {
    font-size: 1.2rem;
}

/* Dynamic artifact download buttons */
.dynamic-download-links {
    margin-top: 15px;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

.dynamic-artifact-btn {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin: 8px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    border: none;
    cursor: pointer;
}

.dynamic-artifact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    color: white;
}

.dynamic-artifact-btn .download-icon {
    font-size: 20px;
    margin-right: 10px;
    min-width: 24px;
}

.dynamic-artifact-btn .download-text {
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
    line-height: 1.3;
}

.dynamic-artifact-btn:disabled,
.dynamic-artifact-btn[href="#"] {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.no-artifacts-message {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
    font-style: italic;
}

.no-artifacts-message .download-icon {
    margin-right: 10px;
    font-size: 18px;
}

.build-controls {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.build-controls h4 {
    text-align: center;
    margin-bottom: 20px;
    color: #fbbf24;
    font-size: 1.2rem;
}

.control-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-align: center;
    cursor: pointer;
}

.cancel-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.retry-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.control-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.control-icon {
    font-size: 1.1rem;
}

.build-details {
    background: rgba(255, 255, 255, 0.06);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.build-details p {
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

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

/* Build Steps Styles */
.build-steps-container {
    margin-top: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.build-steps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.build-steps-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.build-steps-progress {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.build-steps-list {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.build-steps-list::-webkit-scrollbar {
    width: 6px;
}

.build-steps-list::-webkit-scrollbar-track {
    background: transparent;
}

.build-steps-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.build-step {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.build-step:last-child {
    border-bottom: none;
}

.build-step:hover {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding-left: 8px;
    padding-right: 8px;
}

.step-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    position: relative;
}

.step-indicator.pending {
    background: rgba(156, 163, 175, 0.2);
    border: 2px solid rgba(156, 163, 175, 0.3);
    color: rgba(156, 163, 175, 0.7);
}

.step-indicator.in-progress {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    animation: pulse-step 2s infinite;
}

.step-indicator.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.step-indicator.failed {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.step-indicator.canceled {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

@keyframes pulse-step {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
    }
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #ffffff;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.step-details {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.step-duration {
    display: flex;
    align-items: center;
    gap: 4px;
}

.step-type {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 500;
}

.step-log-link {
    color: #60a5fa;
    text-decoration: none;
    font-size: 0.8rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.step-log-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.step-progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 15px;
}

.step-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 2px;
}

.step-progress-fill.success {
    background: linear-gradient(90deg, #10b981, #059669);
    width: 100%;
}

.step-progress-fill.failed {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    width: 100%;
}

.step-progress-fill.canceled {
    background: linear-gradient(90deg, #f59e0b, #d97706);
    width: 100%;
}

.build-overall-progress {
    margin-bottom: 20px;
}

.overall-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.overall-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.overall-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #10b981);
    width: 0%;
    transition: width 0.8s ease;
    border-radius: 4px;
    position: relative;
}

.overall-progress-fill.completed {
    background: linear-gradient(90deg, #10b981, #059669);
}

.overall-progress-fill.failed {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.overall-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Responsive adjustments for build steps */
@media (max-width: 768px) {
    .build-steps-container {
        padding: 15px;
    }

    .build-step {
        padding: 10px 0;
    }

    .step-indicator {
        width: 20px;
        height: 20px;
        margin-right: 12px;
        font-size: 0.7rem;
    }

    .step-name {
        font-size: 0.9rem;
    }

    .step-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .build-steps-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
