/* Production IPO Pulse Styles */

/* System Messages */
.system-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1000;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
}

.system-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.system-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.system-message.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.close-btn {
    background: none;
    border: none;
    float: right;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    color: inherit;
    margin-left: 10px;
}

/* IPO Container */
#ipoContainer, #ipo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* IPO Cards */
.ipo-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #007bff;
}

.ipo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.ipo-card[data-status="open"] {
    border-left-color: #28a745;
}

.ipo-card[data-status="upcoming"] {
    border-left-color: #17a2b8;
}

.ipo-card[data-status="closed"] {
    border-left-color: #ffc107;
}

.ipo-card[data-status="listed"] {
    border-left-color: #6c757d;
}

/* IPO Header */
.ipo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.company-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
    margin-right: 10px;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.badge-light {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

/* IPO Details */
.ipo-details {
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 500;
    color: #666;
    font-size: 14px;
}

.detail-row .value {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    text-align: right;
}

/* IPO Actions */
.ipo-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex: 1;
    min-width: 120px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

/* Statistics */
#ipoStats {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    flex: 1;
    text-align: center;
    min-width: 120px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.stat-item.open .stat-number {
    color: #28a745;
}

.stat-item.upcoming .stat-number {
    color: #17a2b8;
}

.stat-item.closed .stat-number {
    color: #ffc107;
}

.stat-item.listed .stat-number {
    color: #6c757d;
}

/* Loading States */
#loadingSpinner {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Data Messages */
.no-data-message, .fallback-message {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    grid-column: 1 / -1;
}

.no-data-message h3, .fallback-message h3 {
    color: #666;
    margin-bottom: 15px;
}

.fallback-message ul {
    text-align: left;
    max-width: 300px;
    margin: 20px auto;
}

/* Last Updated */
#lastUpdated {
    font-size: 12px;
    color: #666;
    text-align: right;
    padding: 10px 20px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    #ipoContainer, #ipo-grid {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 15px;
    }
    
    .ipo-card {
        padding: 15px;
    }
    
    .ipo-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ipo-actions {
        flex-direction: column;
    }
    
    .btn {
        min-width: auto;
    }
    
    #ipoStats {
        flex-direction: column;
        gap: 10px;
    }
    
    .system-message {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Additional enhancements */
.refresh-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.refresh-btn:hover {
    transform: scale(1.05);
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Header enhancements */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 30px;
}

.page-header h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
}

.page-header p {
    margin: 10px 0 0 0;
    font-size: 16px;
    opacity: 0.9;
}
