/* Base styles */
:root {
    --primary-bg: #000000;
    --secondary-bg: #1d1d1f;
    --card-bg: #1d1d1f;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --accent-color: #2997ff;
    --hover-color: #0071e3;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Hero Section */
.hero {
    min-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(180deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
    padding: 2rem;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #2997ff, #7cc2ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Feature Cards */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    transform: scaleX(0);
    transition: transform var(--transition-speed);
}

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

.card-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1.5rem;
}

.feature-svg {
    fill: var(--accent-color);
    transition: fill var(--transition-speed);
}

.feature-card:hover .feature-svg {
    fill: var(--hover-color);
}

.feature-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.card-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed);
    display: inline-block;
}

.card-link:hover {
    color: var(--hover-color);
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-text {
    animation: fadeUp 0.8s ease-out forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.2rem;
    }
    
    .features {
        grid-template-columns: 1fr;
        padding: 2rem 1rem;
    }
}

/* Form Styling */
.calculator-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--secondary-bg);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

input, select {
    background: var(--primary-bg);
    border: 1px solid #333;
    color: var(--text-primary);
    padding: 0.8rem;
    border-radius: 8px;
    transition: border-color var(--transition-speed);
}

input:focus, select:focus {
    border-color: var(--accent-color);
    outline: none;
}

button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: background var(--transition-speed);
    cursor: pointer;
}

button:hover {
    background: var(--hover-color);
}

/* Calculator Page Specific Styles */
.calculator-page {
    min-height: calc(100vh - 160px);
    padding: 2rem;
    background: linear-gradient(180deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #2997ff, #7cc2ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Form Styling */
.form-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.animated-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-speed);
}

.input-group input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(41, 151, 255, 0.1);
}

.calculate-btn {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

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

/* Result Styling */
.result-container {
    margin-top: 3rem;
    text-align: center;
}

.result-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.result-header {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.result-content {
    transition: all var(--transition-speed);
}

.status {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.status.good { color: #00c853; }
.status.warning { color: #ffd600; }
.status.critical { color: #ff3d00; }

.detail {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.percentage {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.attendance-meter {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-top: 2rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: var(--accent-color);
    transition: width 1s ease-in-out, background-color 0.5s;
}

/* Error State */
.error {
    color: #ff3d00;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-page {
        padding: 1rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    .result-card {
        padding: 1.5rem;
    }
}

/* CGPA Calculator Specific Styles */
.calculator-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    gap: 2rem;
    grid-template-columns: 250px 1fr;
}

/* Grading Scale Card */
.grading-scale-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.grading-scale-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.grade-table {
    display: grid;
    gap: 0.5rem;
}

.grade-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    transition: background var(--transition-speed);
}

.grade-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.grade-row.header {
    font-weight: 600;
    color: var(--accent-color);
}

/* Form Styling */
.input-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.subject-entry {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all var(--transition-speed);
}

.subject-entry:hover {
    background: rgba(255, 255, 255, 0.05);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.input-group input,
.input-group select {
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all var(--transition-speed);
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(41, 151, 255, 0.1);
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.action-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.add-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.add-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

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

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

.remove-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 1.5rem;
}
.remove-btn-container {
    display: flex;
    align-items: flex-end;
    height: 100%;
}

.remove-btn {
    background: rgba(255, 0, 0, 0.1);
    color: #ff3d00;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.remove-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    transform: scale(1.1);
}

/* CGPA Meter */
.cgpa-meter {
    position: relative;
    width: 200px;
    height: 100px;
    margin: 2rem auto 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px 100px 0 0;
    overflow: hidden;
}

.meter-scale {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right, 
        #ff3d00 0%, 
        #ff9100 33%, 
        #ffd600 66%, 
        #00c853 100%
    );
    opacity: 0.2;
}

.meter-pointer {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 10px;
    height: 100px;
    background-color: #ff3d00;
    transform-origin: bottom center;
    transform: rotate(-90deg);
    transition: transform 1s, background-color 0.5s;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff3d00;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    bottom: 20px;
    opacity: 1;
}

/* Result Styling */
.cgpa-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.cgpa-label {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.credits-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .calculator-container {
        grid-template-columns: 1fr;
    }

    .grading-scale-card {
        position: static;
        margin-bottom: 2rem;
    }

    .input-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .cgpa-meter {
        width: 150px;
    }

    .cgpa-value {
        font-size: 2.5rem;
    }
}