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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8fafc;
    color: #334155;
    line-height: 1.6;
    padding-top: 80px; /* Account for fixed header height */
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto 0 auto;
    padding: 0 2rem 4rem 2rem; /* Left/right 2rem, bottom 4rem padding */
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #64748b;
    font-size: 0.9rem;
}

/* Sections */
.section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: #3b82f6;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.project-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.project-role {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 500;
    text-transform: uppercase;
    display: inline-block;
    width: fit-content;
    white-space: nowrap;
}

.project-role.owner {
    background: #dcfce7;
    color: #166534;
}

.project-role.editor {
    background: #dbeafe;
    color: #1e40af;
}

.project-role.viewer {
    background: #f1f5f9;
    color: #475569;
}

.project-settings-btn {
    background: none;
    border: none;
    font-size: 1.125rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}

.project-settings-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
    transform: scale(1.1);
}

.project-settings-btn:active {
    transform: scale(0.95);
}

.project-description {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.project-platforms {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.platform-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
}

.project-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #64748b;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-icon {
    font-size: 4rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

/* Activity List */
.activity-list {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.activity-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.activity-content {
    color: #374151;
}

.activity-time {
    font-size: 0.85rem;
    color: #64748b;
}

/* Buttons */
.btn {
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn span {
    pointer-events: none;
}

.btn-primary {
    background: #1f2937;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #374151;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(31, 41, 55, 0.3);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
    color: #334155;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.btn-spinner {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-spinner {
    display: inline;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    /* Hide scrollbar for Chrome, Safari and Opera */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.modal-content::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    display: none; /* WebKit */
}

.modal-header {
    padding: 1rem 1.25rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #374151;
}

.modal-body {
    padding: 1rem 1.25rem;
}

.modal-footer {
    padding: 0 1.25rem 1rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Project Settings Modal */
.project-settings-modal {
    max-width: 550px;
    max-height: 85vh;
}

.settings-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.settings-actions {
    display: none;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

/* Platforms List */
.platforms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.platforms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0;
}

.platform-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #475569;
}

.platform-icon {
    font-size: 0.9rem;
}

/* SDK Tokens List */
.tokens-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.token-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
}

.token-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.token-platform {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    text-transform: uppercase;
}

.token-value {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.625rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    color: #374151;
    word-break: break-all;
    position: relative;
}

.copy-token-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-token-btn:hover {
    background: #e5e7eb;
}

/* Members List */
.members-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.member-item.invited {
    background: #fef3c7;
    border-color: #f59e0b;
    opacity: 0.8;
}

.member-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.member-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.invited-tag {
    background: #f59e0b;
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 500;
    text-transform: uppercase;
}

.member-email {
    font-size: 0.75rem;
    color: #64748b;
}

.member-role {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.member-role.owner {
    background: #dcfce7;
    color: #166534;
}

.member-role.editor {
    background: #dbeafe;
    color: #1e40af;
}

.member-role.viewer {
    background: #f1f5f9;
    color: #475569;
}

.current-user-tag {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    background: #f0f9ff;
    color: #0369a1;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
    border: 1px solid #bae6fd;
}

.member-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-remove {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: #fecaca;
    transform: translateY(-1px);
}

.btn-leave {
    background: #fef3c7;
    color: #d97706;
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-leave:hover {
    background: #fde68a;
    transform: translateY(-1px);
}

/* Danger Zone */
.danger-zone {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
}

.danger-zone h4 {
    color: #dc2626;
}

.danger-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.danger-info {
    flex: 1;
}

.danger-info strong {
    color: #dc2626;
    font-size: 0.85rem;
}

.danger-info p {
    color: #7f1d1d;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    line-height: 1.4;
}

.danger-confirm-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    color: #7f1d1d;
    font-size: 0.75rem;
    cursor: pointer;
}

.danger-confirm-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    transform: scale(1.1);
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-danger:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Form Elements */
.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
    background-color: #fefefe;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: white;
}

.input-group textarea {
    resize: vertical;
}

.input-group textarea::placeholder {
    font-size: 0.85rem;
    color: #9ca3af;
}

.field-note {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.375rem;
    line-height: 1.4;
    font-style: italic;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.75rem;
    padding: 0.1rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.checkbox-label:hover {
    background: #f8fafc;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Messages */
.message-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    max-width: 400px;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1500;
    transition: all 0.3s ease;
}

.message-container.success {
    background-color: #10b981;
    color: white;
}

.message-container.error {
    background-color: #ef4444;
    color: white;
}

.message-container.info {
    background-color: #3b82f6;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    .container {
        padding: 0 1rem 4rem 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .message-container {
        margin: 1rem;
        left: 1rem;
        right: 1rem;
        width: auto;
    }
}

/* Project Settings Modal Spacing Adjustments - DASHBOARD */
#projectSettingsModal .modal-body .settings-section {
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.5rem !important;
}

#projectSettingsModal .modal-body .settings-section:first-child {
    margin-bottom: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

/* Specifically target the project description section */
#projectSettingsModal .modal-body .settings-section:nth-child(2) {
    margin-bottom: 0.5rem !important;
    padding-bottom: 0.25rem !important;
}

/* Target the specific description area within the first settings section */
#projectSettingsModal .modal-body .settings-section:first-child #descriptionActions {
    margin-bottom: 0 !important;
}

#projectSettingsModal .modal-body .settings-section:first-child .input-group:last-child {
    margin-bottom: 0.25rem !important;
}

/* Target the description input-group specifically */
#projectSettingsModal .modal-body .settings-section:first-child .input-group:nth-child(2) {
    margin-bottom: 0.25rem !important;
}

/* Reduce space after project description textarea */
#projectSettingsModal .modal-body #settingsProjectDescription {
    margin-bottom: 0.25rem !important;
}

/* Languages List - Dashboard */
.languages-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.language-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

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

.language-item:hover {
    background: transparent;
}

.language-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
}

.language-name {
    font-weight: 500;
    color: #334155;
    font-size: 0.875rem;
}

.language-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-delete-language {
    padding: 0.375rem 0.75rem;
    background: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete-language:hover {
    background: #dc2626;
    color: white;
}

.btn-delete-language:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

.input-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
    background-color: #fefefe;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 2.5rem;
}

.input-group select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: white;
} 