@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
    --color-primary: #2d3748;
    --color-secondary: #4a5568;
    --color-accent: #667eea;
    --color-accent-dark: #5a67d8;
    --color-success: #48bb78;
    --color-danger: #f56565;
    --color-warning: #ed8936;
    --color-bg: #f7fafc;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #2d3748;
    --color-text-light: #718096;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.06), 0 4px 6px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.08), 0 10px 10px rgba(0,0,0,0.04);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cpm-portal-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.cpm-portal-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-50px, 50px) rotate(180deg); }
}

/* ============================================
   AUTH SECTION
============================================ */

.cpm-auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.cpm-auth-box {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 100%;
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cpm-auth-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cpm-auth-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cpm-logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    letter-spacing: -0.5px;
}

.cpm-tagline {
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

.cpm-tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
}

.cpm-tab {
    flex: 1;
    padding: 1.25rem;
    background: none;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-light);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.cpm-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-accent);
    transform: scaleX(0);
    transition: var(--transition);
}

.cpm-tab.active {
    color: var(--color-accent);
}

.cpm-tab.active::after {
    transform: scaleX(1);
}

.cpm-tab:hover {
    color: var(--color-accent);
}

.cpm-tab-content {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.4s ease-out;
}

.cpm-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cpm-form-group {
    margin-bottom: 1.5rem;
}

.cpm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.cpm-form-group label {
    display: block;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cpm-form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--color-bg);
}

.cpm-form-group input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.cpm-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.cpm-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cpm-btn:hover::before {
    width: 300px;
    height: 300px;
}

.cpm-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cpm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.cpm-btn-secondary:hover {
    background: var(--color-primary);
    transform: translateY(-2px);
}

.cpm-btn-icon {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
}

.cpm-message {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: none;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cpm-message.success {
    background: #c6f6d5;
    color: #22543d;
    border: 2px solid #48bb78;
    display: block;
}

.cpm-message.error {
    background: #fed7d7;
    color: #742a2a;
    border: 2px solid #f56565;
    display: block;
}

/* ============================================
   DASHBOARD SECTION
============================================ */

.cpm-dashboard {
    min-height: 100vh;
    display: flex;
    background: var(--color-bg);
}

.cpm-sidebar {
    width: 280px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.cpm-sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cpm-sidebar-logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.cpm-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cpm-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1.125rem;
    border: 2px solid rgba(255,255,255,0.3);
}

.cpm-user-details {
    flex: 1;
    min-width: 0;
}

.cpm-user-name {
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cpm-user-email {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cpm-nav {
    flex: 1;
    padding: 1.5rem 0;
}

.cpm-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.cpm-nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.cpm-nav-item:hover {
    background: var(--color-bg);
    color: var(--color-accent);
}

.cpm-nav-item.active {
    background: rgba(102, 126, 234, 0.08);
    color: var(--color-accent);
    border-left-color: var(--color-accent);
}

.cpm-sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.cpm-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: var(--transition);
}

.cpm-logout-btn svg {
    width: 18px;
    height: 18px;
}

.cpm-logout-btn:hover {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

.cpm-main {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    overflow-y: auto;
}

.cpm-section {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.cpm-section.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cpm-section-header {
    margin-bottom: 2rem;
}

.cpm-section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.cpm-section-header p {
    font-size: 1rem;
    color: var(--color-text-light);
}

.cpm-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.cpm-card:hover {
    box-shadow: var(--shadow-md);
}

.cpm-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

.cpm-upload-form {
    margin-bottom: 1.5rem;
}

.cpm-upload-area {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    background: var(--color-bg);
}

.cpm-upload-area:hover {
    border-color: var(--color-accent);
    background: rgba(102, 126, 234, 0.05);
}

.cpm-upload-area svg {
    width: 48px;
    height: 48px;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.cpm-upload-area p {
    color: var(--color-text-light);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.cpm-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.cpm-documents-list {
    display: grid;
    gap: 1rem;
}

.cpm-document-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.cpm-document-item:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
}

.cpm-document-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cpm-document-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.cpm-document-info {
    flex: 1;
    min-width: 0;
}

.cpm-document-name {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cpm-document-meta {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.cpm-document-status {
    padding: 0.375rem 0.875rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cpm-document-status.pending {
    background: #fef3c7;
    color: #78350f;
}

.cpm-document-status.approved {
    background: #d1fae5;
    color: #065f46;
}

.cpm-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.cpm-link-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.cpm-link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: var(--transition);
}

.cpm-link-card:hover::before {
    transform: scaleX(1);
}

.cpm-link-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.cpm-link-icon {
    width: 48px;
    height: 48px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.cpm-link-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-accent);
}

.cpm-link-title {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.cpm-link-description {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.cpm-link-url {
    font-size: 0.875rem;
    color: var(--color-accent);
    font-family: 'Space Mono', monospace;
    word-break: break-all;
}

.cpm-tasks-list {
    display: grid;
    gap: 1rem;
}

.cpm-task-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: var(--transition);
}

.cpm-task-item:hover {
    box-shadow: var(--shadow-sm);
}

.cpm-task-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cpm-task-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    position: relative;
    margin-top: 0.125rem;
}

.cpm-task-checkbox:hover {
    border-color: var(--color-accent);
}

.cpm-task-checkbox.checked {
    background: var(--color-success);
    border-color: var(--color-success);
}

.cpm-task-checkbox.checked::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 7px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cpm-task-content {
    flex: 1;
}

.cpm-task-title {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.cpm-task-description {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.cpm-task-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--color-text-light);
}

.cpm-task-project {
    padding: 0.25rem 0.625rem;
    background: rgba(102, 126, 234, 0.1);
    color: var(--color-accent);
    border-radius: 4px;
    font-weight: 600;
}

.cpm-loading {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-light);
    font-size: 1rem;
}

/* ============================================
   RESPONSIVE
============================================ */

@media (max-width: 768px) {
    .cpm-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .cpm-sidebar.active {
        transform: translateX(0);
    }
    
    .cpm-main {
        margin-left: 0;
    }
    
    .cpm-form-row {
        grid-template-columns: 1fr;
    }
    
    .cpm-links-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ANIMATIONS
============================================ */

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

.cpm-loading {
    animation: pulse 2s ease-in-out infinite;
}
